-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
ptuning训练后无法加载预测数据[BUG/Help] <title> #457
Comments
之前的tokenizer config保存的时候有点问题,你可以先把tokenizer换成 |
│ /mnt/data/rz/programe/glm/venv/lib/python3.8/site-packages/transformers/generation/utils.py:1406 │ |
Duplicate of #432 |
Is there an existing issue for this?
Current Behavior
训练好的ptuning模型,无法用cli_demo加载预测。发生最大token溢出情况。
tokenizer = AutoTokenizer.from_pretrained('ptuning/outputs/adgen-chatglm-6b-pt-8-dev/checkpoint-6000', trust_remote_code=True) model = AutoModel.from_pretrained('ptuning/outputs/adgen-chatglm-6b-pt-8-dev/checkpoint-6000', trust_remote_code=True).half().cuda() model = model.eval()
Expected Behavior
预测时发生错误
Traceback (most recent call last): File "cli_demo_trained.py", line 57, in <module> main() File "cli_demo_trained.py", line 42, in main for response, history in model.stream_chat(tokenizer, query, history=history): File "/usr/local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 43, in generator_context response = gen.send(None) File "/root/.cache/huggingface/modules/transformers_modules/checkpoint-6000/modeling_chatglm.py", line 1281, in stream_chat for outputs in self.stream_generate(**inputs, **gen_kwargs): File "/usr/local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 43, in generator_context response = gen.send(None) File "/root/.cache/huggingface/modules/transformers_modules/checkpoint-6000/modeling_chatglm.py", line 1356, in stream_generate model_inputs = self.prepare_inputs_for_generation(input_ids, **model_kwargs) File "/root/.cache/huggingface/modules/transformers_modules/checkpoint-6000/modeling_chatglm.py", line 1091, in prepare_inputs_for_generation mask_positions = [seq.index(mask_token) for seq in seqs] File "/root/.cache/huggingface/modules/transformers_modules/checkpoint-6000/modeling_chatglm.py", line 1091, in <listcomp> mask_positions = [seq.index(mask_token) for seq in seqs] ValueError: 130000 is not in list
Steps To Reproduce
在ptuning下运行train.sh生成模型。
通过cli_demo进行终端交互加载。
输入预测问题时返回错误。
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: