You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
你好 我在训练好lora,使用merge_lora后尝试调用模型时候产生了下列错误,您能帮我看看哪里出问题了吗?谢谢!
(ChatGLM) @n1:~/ChatGLM-Finetuning-master$ python test.py
Traceback (most recent call last):
File "test.py", line 7, in
tokenizer = ChatGLMTokenizer.from_pretrained(model_dir)
File "/home/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2048, in from_pretrained
return cls._from_pretrained(
File "/home/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2287, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "/home/ChatGLM-Finetuning-master/glm3/tokenization_chatglm.py", line 108, in init
super().init(padding_side=padding_side, clean_up_tokenization_spaces=clean_up_tokenization_spaces,
File "/home/.local/lib/python3.8/site-packages/transformers/tokenization_utils.py", line 363, in init
super().init(**kwargs)
File "/home/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1603, in init
super().init(**kwargs)
File "/home/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 861, in init
setattr(self, key, value)
AttributeError: can't set attribute
//下列是我的测试代码
import torch
from transformers import AutoTokenizer, AutoModel
from glm3.tokenization_chatglm import ChatGLMTokenizer
model_dir='./output-glm3/epoch-2-step-720/'
//使用 ChatGLMTokenizer 从本地路径加载分词器
tokenizer = ChatGLMTokenizer.from_pretrained(model_dir)
model = AutoModel.from_pretrained(model_dir, trust_remote_code=True).to("cuda").eval()
//测试模型
response, history = model.chat(tokenizer, "hello", history=[])
print("Response:", response)
No description provided.
The text was updated successfully, but these errors were encountered: