Open 2259819800 opened 4 weeks ago
我也遇到了相同的问题,请大佬解答!!
Exception Message: 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
File "F:\Stable Diffusion ComfyUI\execution.py", line 317, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "F:\Stable Diffusion ComfyUI\execution.py", line 192, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "F:\Stable Diffusion ComfyUI\execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "F:\Stable Diffusion ComfyUI\execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "F:\Stable Diffusion ComfyUI\custom_nodes\ComfyUI_LayerStyle\py\phi_nodes.py", line 82, in phi_prompt
output = pipe(messages, **generation_args)
File "F:\Stable Diffusion ComfyUI\python\lib\site-packages\transformers\pipelines\text_generation.py", line 267, in __call__
return super().__call__(Chat(text_inputs), **kwargs)
File "F:\Stable Diffusion ComfyUI\python\lib\site-packages\transformers\pipelines\base.py", line 1302, in __call__
return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
File "F:\Stable Diffusion ComfyUI\python\lib\site-packages\transformers\pipelines\base.py", line 1308, in run_single
model_inputs = self.preprocess(inputs, **preprocess_params)
File "F:\Stable Diffusion ComfyUI\python\lib\site-packages\transformers\pipelines\text_generation.py", line 301, in preprocess
inputs = self.tokenizer.apply_chat_template(
File "F:\Stable Diffusion ComfyUI\python\lib\site-packages\transformers\tokenization_utils_base.py", line 1803, in apply_chat_template
chat_template = self.get_chat_template(chat_template, tools)
File "F:\Stable Diffusion ComfyUI\python\lib\site-packages\transformers\tokenization_utils_base.py", line 1967, in get_chat_template
raise ValueError(
## System Information
- **ComfyUI Version:** v0.2.2
- **Arguments:** F:\Stable Diffusion ComfyUI\main.py --auto-launch --preview-method none --disable-smart-memory --disable-cuda-malloc --cpu-vae --fast
- **OS:** nt
- **Python Version:** 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
- **Embedded Python:** false
- **PyTorch Version:** 2.4.1+cu124
## Devices
- **Name:** cuda:0 NVIDIA GeForce RTX 4060 Laptop GPU : cudaMallocAsync
- **Type:** cuda
- **VRAM Total:** 8585216000
- **VRAM Free:** 7431258112
- **Torch VRAM Total:** 0
- **Torch VRAM Free:** 0
报错消息如下 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