Skip to content

运行code03_build_model_show.ipynb 出现问题 #209

@daixiongming

Description

@daixiongming

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

请问如何解决这个问题。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions