Chat Templates for BlenderBot
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 fromTemplates for Chat Modelsunder 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_codeexec(code_obj, self.user_global_ns, self.user_ns)File “”, line 10, intokenizer.apply_chat_template(chat, tokenize=False)AttributeError: ‘BlenderbotTokenizerFast’ object has no attribute ‘apply_chat_template’I need clues!
2023-10-11T15:10:58Z
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.
2023-10-11T18:50:38Z
Thanks, but this is not a syntax issue.  It is an object model issue.  Clearly there is an install dependency problem.
2024-07-03T00:05:37Z
Hi,@bogolese, Did you manage to fix this dependancy issue?
2024-09-02T08:38:28Z
Hi,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
2024-09-02T08:54:55Z
Opened an issue here:ValueError: Cannot use apply_chat_template() because tokenizer.chat_template is not set · Issue #33246 · huggingface/transformers · GitHub