I have installed transformers==4.34.0, tokenizers=0.14.1, and huggingface_hub=0.18.0 on Ubuntu 20 and I am trying to run the bog standard sample chat templates code from Templates for Chat Models under PyCharm. The error I consistently get is:
Traceback (most recent call last):
File â/usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.pyâ, line 3433, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File ââ, line 10, in
tokenizer.apply_chat_template(chat, tokenize=False)
AttributeError: âBlenderbotTokenizerFastâ object has no attribute âapply_chat_templateâ
I generally solve this type of problem by asking chat-gpt. Just past your full code there and then add to the prompt the complete error (specifying the line) and ask for the correct code.
Donât be afraid to ask if you have any problems.
Blenderbot does not have a chat template set (thereâs no âchat_templateâ attribute in the tokenizer_config.json). Weâre going to update the docs to mention another model. cc @Rocketknight1