Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Chat Template | Finetuning error #180

Open
jloadbeach opened this issue Jan 8, 2025 · 1 comment
Open

Missing Chat Template | Finetuning error #180

jloadbeach opened this issue Jan 8, 2025 · 1 comment

Comments

@jloadbeach
Copy link

Hi together,

I tried to fine-tune the model to my dataset. To do this, I first tried the dummy dataset to get familiar with it. I executed the following command. As a model, I load the 3B model directly from Huggingface. Unfortunately, I get the attached error. If I pass a chat template, I later encounter an error, so I assume that I have passed a wrong template. According to the mapping in the code, the vincuna_v1.5 template must be used, but it does not work. Does anyone have a solution for this?
Thank you!

Command:
bash scripts/NVILA-Lite/sft.sh Efficient-Large-Model/VILA1.5-3b dummy

Error:
...
[rank0]: text = tokenizer.apply_chat_template(
[rank0]: File "/anaconda/envs/vila/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 1803, in apply_chat_template
[rank0]: chat_template = self.get_chat_template(chat_template, tools)
[rank0]: File "/anaconda/envs/vila/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 1967, in get_chat_template
[rank0]: raise ValueError(
[rank0]: 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 at https://huggingface.co/docs/transformers/main/en/chat_templating

@HoTuanLong
Copy link

Hi @jloadbeach, I've met the same issue with you. Have you found a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants