File "/root/anaconda3/envs/llm/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 847, in __init__ setattr(self, key, value) AttributeError: can't set attribute 'eos_token'
zzdxjtu opened this issue · comments
应该是tokenizer文件的问题
我也遇到了同样的报错,报错信息如下:
File "/mnt/d/Projects/Python/ChatGLM-Finetuning/glm3/tokenization_chatglm.py", line 108, in __init__
super().__init__(padding_side=padding_side, clean_up_tokenization_spaces=clean_up_tokenization_spaces,
显示报错代码出现在了 glm3/tokenization_chatglm.py
代码中。
所以我从最新的 ChatGLM3-6B 的 Huggingface 页面中,下载最新的 tokenization_chatglm.py
文件,并替换该项目下的 glm3/tokenization_chatglm.py
文件。
经修改后,我的问题已解决,代码可以正常运行。