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

运行infer.sh 报错 #15

Open
godcmappalling opened this issue Aug 17, 2023 · 2 comments
Open

运行infer.sh 报错 #15

godcmappalling opened this issue Aug 17, 2023 · 2 comments

Comments

@godcmappalling
Copy link

运行报错代码如下:
###infering###
((), (), (), ()) tensor([0, 0, 0, 0], device='cuda:0')
Traceback (most recent call last):
File "/home/pxc/Cornucopia-LLaMA-Fin-Chinese/infer.py", line 168, in
main()
File "/home/pxc/Cornucopia-LLaMA-Fin-Chinese/infer.py", line 154, in main
infer_from_json(args.instruct_dir)
File "/home/pxc/Cornucopia-LLaMA-Fin-Chinese/infer.py", line 145, in infer_from_json
model_output = evaluate(instruction)
File "/home/pxc/Cornucopia-LLaMA-Fin-Chinese/infer.py", line 120, in evaluate
generation_output = model.generate(
File "/home/zengbo/anaconda3/envs/Cornucopia/lib/python3.10/site-packages/peft-0.5.0.dev0-py3.10.egg/peft/peft_model.py", line 1002, in generate
File "/home/zengbo/anaconda3/envs/Cornucopia/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/zengbo/anaconda3/envs/Cornucopia/lib/python3.10/site-packages/transformers/generation/utils.py", line 1628, in generate
return self.beam_search(
File "/home/zengbo/anaconda3/envs/Cornucopia/lib/python3.10/site-packages/transformers/generation/utils.py", line 3010, in beam_search
beam_indices = tuple((beam_indices[beam_idx[i]] + (beam_idx[i],) for i in range(len(beam_indices))))
File "/home/zengbo/anaconda3/envs/Cornucopia/lib/python3.10/site-packages/transformers/generation/utils.py", line 3010, in
beam_indices = tuple((beam_indices[beam_idx[i]] + (beam_idx[i],) for i in range(len(beam_indices))))
IndexError: tuple index out of range

=============================
若不进行生成model.generate,直接输出模型推理结果,返回值有大量nan

@jerry1993-tech
Copy link
Owner

jerry1993-tech commented Aug 18, 2023

你好,欢迎支持聚宝盆!
你的问题我试了一下,我这边跑infer.sh 没问题。
我的运行环境及包版本:
python=3.9.16 (推荐使用 python3.9)
peft==0.5.0.dev0
transformers==4.31.0

@godcmappalling
Copy link
Author

godcmappalling commented Aug 21, 2023

你好,欢迎支持聚宝盆! 你的问题我试了一下,我这边跑infer.sh 没问题。 我的运行环境及包版本: python=3.9.16 (推荐使用 python3.9) peft==0.5.0.dev0 transformers==4.31.0

可以提供一下其他包的版本,以及CUDA版本吗?改成python3.9还是有报错

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

2 participants