Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: 150001 is not in list #33

Open
magnificent1208 opened this issue Apr 6, 2023 · 7 comments
Open

ValueError: 150001 is not in list #33

magnificent1208 opened this issue Apr 6, 2023 · 7 comments

Comments

@magnificent1208
Copy link

image

@nieallen
Copy link

nieallen commented Apr 7, 2023

同样的错误,你解决了吗

@HarderThenHarder
Copy link
Owner

Hi,这是因为 ChatGLM 官方更新了模型,您可以 pull 一下最新的代码来解决该问题。

具体来讲:

  1. 这里 修改为 AutoModel 来加载模型。
  2. 这里 不再需要传入 attention_maskposition_ids
  3. 构建数据时 同样也不需要再构建 attention_maskposition_ids

所以,您也可以尝试直接替换 train.pyutils.py 这两个文件即可。

@nieallen
Copy link

nieallen commented Apr 7, 2023

Hi,我已是最新代码,昨天跑没有问题,但是今天早上来跑,环境自动重新下载了chatglm模型,所以可能是chatglm又更新了模型,造成这个错误

@magnificent1208
Copy link
Author

image
用新代码训练的模型,inference的时候出现如下问题

@HarderThenHarder
Copy link
Owner

HarderThenHarder commented Apr 7, 2023

看起来像是用了之前文件的缓存,尝试一下删除之前的缓存:
rm -r ~/.cache/huggingface/modules/transformers_modules/THUDM/
再重新跑下代码试试 :)

对了,如果用新代码训练出来的模型,在 inference.py 中也需要对应的修改为 AutoModel 加载,如果您删除缓存后还是无法正常运行大概率是因为这里的问题,这部分我还没有修改,我会尽快抽时间修改完后上传。

@magnificent1208
Copy link
Author

看起来像是用了之前文件的缓存,尝试一下删除之前的缓存: rm -r ~/.cache/huggingface/modules/transformers_modules/THUDM/ 再重新跑下代码试试 :)

对了,如果用新代码训练出来的模型,在 inference.py 中也需要对应的修改为 AutoModel 加载,如果您删除缓存后还是无法正常运行大概率是因为这里的问题,这部分我还没有修改,我会尽快抽时间修改完后上传。

我这块跑通了,就是用AutoModel里面的model.chat()就行。
需要切割的话,对response处理就行

@nieallen
Copy link

Hi ,最新的代码,inference有点问题,会报ValueError: 130000 is not in list错误,但把tokenizer换成THUDM/chatglm-6b,而不是微调后模型保存路径就可以解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants