# Chat Templates for BlenderBot

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%3E%5C
**Category:** 🤗Transformers\
**Created:** [October 11, 2023, 2:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184 "2023-10-11T14:56:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogolese](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bogolese/32/53040_2.png) [@bogolese](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbogolese)%5C
**Post date:** [October 11, 2023, 2:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%2F1 "2023-10-11T14:56:57Z")

</div>

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](https://huggingface.co/docs/transformers/main/en/chat_templating) 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 need clues! 🙂

---

<div class="post-metadata">

**Author:** ![Elciccio](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@Elciccio](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FElciccio)%5C
**Post date:** [October 11, 2023, 3:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%2F2 "2023-10-11T15:10:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bogolese](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bogolese/32/53040_2.png) [@bogolese](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbogolese)%5C
**Post date:** [October 11, 2023, 6:50pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%2F3 "2023-10-11T18:50:38Z")

</div>

Thanks, but this is not a syntax issue. It is an object model issue. Clearly there is an install dependency problem.

---

<div class="post-metadata">

**Author:** ![hitarush](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@hitarush](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fhitarush)%5C
**Post date:** [July 3, 2024, 12:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%2F4 "2024-07-03T00:05:37Z")

</div>

Hi, @bogolese, Did you manage to fix this dependancy issue?

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [September 2, 2024, 8:38am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%2F5 "2024-09-02T08:38:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [September 2, 2024, 8:54am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%2F6 "2024-09-02T08:54:55Z")

</div>

Opened an issue here: [ValueError: Cannot use apply\_chat\_template() because tokenizer.chat\_template is not set · Issue #33246 · huggingface/transformers · GitHub](https://github.com/huggingface/transformers/issues/33246)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [August 25, 2025, 4:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchat-templates-for-blenderbot%2F58184%2F7 "2025-08-25T16:11:42Z")

</div>

Closed on August 25, 2025, 4:11pm UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
