liucongg / ChatGLM-Finetuning

基于ChatGLM-6B、ChatGLM2-6B、ChatGLM3-6B模型,进行下游具体任务微调,涉及Freeze、Lora、P-tuning、全参微调等

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

截屏2023-12-15 下午6 37 03 你好,想问问这个是什么原因?

应该是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 文件。

经修改后,我的问题已解决,代码可以正常运行。