Cannot use chat template functions because tokenizer.chat_template is not set
The following Python script using Dolphin3.0 works well:from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM

model_name = "cognitivecomputations/Dolphin3.0-Llama3.2-3B"

chat = [
    {"role": "system", "content": "You are a philosopher"},
    {"role": "assistant", "content": "Hello, Eve!"},
    {"role": "user", "content": "Hello, Adam!"}
]
    
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)

response = pipe(chat, max_new_tokens=32)
print(response[0]['generated_text'][-1]['content'])However if I change the model name to:model_name = "ObsidianLite/Euryale-1.3-Small-7B"I encounter an error at the line where pipe is called:ValueError: Cannot use chat template functions because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation atChat TemplatesCan someone help me correct my script?Thank you!
2025-01-27T16:01:45Z
Aside from the solution, I think the problem is probably this…Chat_template is not set & throwing error🤗TokenizersWhen I am running the sample code fromhere: 
tokenizer = AutoTokenizer.from_pretrained("facebook/blenderbot-400M-distill")

chat = [
   {"role": "user", "content": "Hello, how are you?"},
   {"role": "assistant", "content": "I'm doing great. How can I help you today?"},
   {"role": "user", "content": "I'd like to show off how chat templating works!"},
]

tokenizer.apply_chat_template(chat, tokenize=False)

I get the error message: 
ValueError: Cannot use apply_chat_template() because tokenizer.…