Skip to content

运行code03_build_model_show.ipynb 出现问题 #209

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

Open
daixiongming opened this issue Mar 12, 2025 · 0 comments
Open

运行code03_build_model_show.ipynb 出现问题 #209

daixiongming opened this issue Mar 12, 2025 · 0 comments

Comments

@daixiongming
Copy link

Traceback (most recent call last):
File "C:\Users\admin\PycharmProjects\PythonProject5\VL_test.py", line 22, in
prompt = llava_processor.tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
File "C:\Users\admin\PycharmProjects\PythonProject5.venv\Lib\site-packages\transformers\tokenization_utils_base.py", line 1629, in apply_chat_template
chat_template = self.get_chat_template(chat_template, tools)
File "C:\Users\admin\PycharmProjects\PythonProject5.venv\Lib\site-packages\transformers\tokenization_utils_base.py", line 1805, in get_chat_template
raise ValueError(
...<4 lines>...
)
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

请问如何解决这个问题。

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

1 participant