jerry1993-tech / Cornucopia-LLaMA-Fin-Chinese

聚宝盆(Cornucopia): 中文金融系列开源可商用大模型,并提供一套高效轻量化的垂直领域LLM训练框架(Pretraining、SFT、RLHF、Quantize等)
https://zhuanlan.zhihu.com/p/633736418
Apache License 2.0
588 stars 61 forks source link

运行infer.sh 报错 #15

Open godcmappalling opened 1 year ago

godcmappalling commented 1 year ago

运行报错代码如下:

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 commented 1 year ago

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

godcmappalling commented 1 year ago

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

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