shibing624 / MedicalGPT

MedicalGPT: Training Your Own Medical GPT Model with ChatGPT Training Pipeline. 训练医疗大模型,实现了包括增量预训练(PT)、有监督微调(SFT)、RLHF、DPO、ORPO。
Apache License 2.0
3.34k stars 499 forks source link

ziya-llama-13b + lora推理结果异常 #34

Closed kyang888 closed 1 year ago

kyang888 commented 1 year ago

使用inference.py,发现结果异常

python inference.py --model_type llama --base_model IDEA-CCNL/Ziya-LLaMA-13B-v1 --lora_model shibing624/ziya-llama-13b-medical-lora --with_prompt --interactive

下载base model 3441687684408_ pic

下载lora权重 3431687684381_ pic

环境: peft 0.3.0 torch 2.0.0+cu118 transformers 4.30.2

shibing624 commented 1 year ago

ziya(子牙)模型使用方法不对,看下IDEA-CCNL/Ziya-LLaMA-13B-v1的使用说明,该模型需要合并才是完整的模型权重。

kyang888 commented 1 year ago

好的,十分感谢

---- 回复的原邮件 ---- | 发件人 | Ming Xu @.> | | 日期 | 2023年06月25日 17:38 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [shibing624/MedicalGPT] 推理结果异常 (Issue #34) |

ziya(子牙)模型使用方法不对,看下IDEA-CCNL/Ziya-LLaMA-13B-v1的使用说明,该模型需要合并才是完整的模型权重。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

dage0127 commented 1 year ago

用这个执行也报同样错误: python gradio_demo.py --base_model IDEA-CCNL/Ziya-LLaMA-13B-v1 --lora_model shibing624/ziya-llama-13b-medical-lora --gpus 0,1 --model_type llama

shibing624 commented 1 year ago

看下IDEA-CCNL/Ziya-LLaMA-13B-v1的使用说明,该模型需要合并才是完整的模型权重。

dage0127 commented 1 year ago

是参考这个页面的说明么? https://huggingface.co/IDEA-CCNL/Ziya-LLaMA-13B-v1

可是我自己的服务器上已经有转换好的IDEA-CCNL/Ziya-LLaMA-13B-v1模型参数了,应该可以直接使用了,问题原因在哪里呢。

(gpt) llm@ht-PowerEdge-R740:/home/haitaiwork/gen/Fengshenbang-LM-main/fengshen/utils$ ll ~/.cache/huggingface/hub/models--IDEA-CCNL--Ziya-LLaMA-13B-v1/snapshots/fccf34387d2c9f2f95ff59ae380e6de3718e41ff/ 总用量 124 drwxrwxr-x 2 llm llm 4096 6月 26 10:31 ./ drwxrwxr-x 3 llm llm 4096 6月 26 09:05 ../ lrwxrwxrwx 1 llm llm 52 6月 26 09:05 added_tokens.json -> ../../blobs/ac47931a423c09e6907dc1ce771b0d2e5d9baac3 lrwxrwxrwx 1 llm llm 52 6月 26 09:05 config.json -> ../../blobs/8789a9d9bf830dc2aaa304fa7eb0d0a1482d7b65 lrwxrwxrwx 1 llm llm 52 6月 26 10:31 generation_config.json -> ../../blobs/2c057487fd479614df7ac437b5ae2faedb245063 lrwxrwxrwx 1 llm llm 76 6月 26 09:07 pytorch_model-00001-of-00028.bin -> ../../blobs/23fc9735c66896bc90316f916da4575c1c845e35c2987f961148d13af5f058cd lrwxrwxrwx 1 llm llm 76 6月 26 09:10 pytorch_model-00002-of-00028.bin -> ../../blobs/81eb8e86db149746e75a283774dc39e95c6d21deae25c75de8b2dc454048d3b5 lrwxrwxrwx 1 llm llm 76 6月 26 09:13 pytorch_model-00003-of-00028.bin -> ../../blobs/e23f4df4d8d1a443e9439d8c341f86bc5338ad2b3def759bf80256d7fed0d4dd lrwxrwxrwx 1 llm llm 76 6月 26 09:16 pytorch_model-00004-of-00028.bin -> ../../blobs/9b61d1672b5571ad44a7a763017ee2f92464dfc9f7a3e6d5b56ec01165ad1a0e lrwxrwxrwx 1 llm llm 76 6月 26 09:18 pytorch_model-00005-of-00028.bin -> ../../blobs/06c8806bdb6775f91d4adb32a36114267dd6f7a93a80f717a739d879a86e91ce lrwxrwxrwx 1 llm llm 76 6月 26 09:21 pytorch_model-00006-of-00028.bin -> ../../blobs/514462397cc59434916e3071de7c89a192e81df4c378a5d299f5bc7a508c0bf7 lrwxrwxrwx 1 llm llm 76 6月 26 09:24 pytorch_model-00007-of-00028.bin -> ../../blobs/7bbb816d7ceed28b34aa2107296b13b2031568b7a9e8b844d40a92e76ad78fc8 lrwxrwxrwx 1 llm llm 76 6月 26 09:26 pytorch_model-00008-of-00028.bin -> ../../blobs/96af0f47f9c6da189110ea243f24141a1d7ff7eab5c5b2e1961ef1c1cba20dbf lrwxrwxrwx 1 llm llm 76 6月 26 09:29 pytorch_model-00009-of-00028.bin -> ../../blobs/1463d7d3c6b9afd9513cd8bb2c4dda2e6d5667ebc1a69e81944a7f34ad458eaa lrwxrwxrwx 1 llm llm 76 6月 26 09:31 pytorch_model-00010-of-00028.bin -> ../../blobs/e5af1f1d941286cd7d9d7bb4fbd6d041555b0bbc40403879518bcbd532b9af27 lrwxrwxrwx 1 llm llm 76 6月 26 09:34 pytorch_model-00011-of-00028.bin -> ../../blobs/cf096fda017dd723bc545e432b52a0b6aaf456fc0a73b6d983c42abd5c1c64b0 lrwxrwxrwx 1 llm llm 76 6月 26 09:37 pytorch_model-00012-of-00028.bin -> ../../blobs/b92925f0b58f4c7a2f1c91e17e7f9835070279ef912e61147dba45a22ef34b5b lrwxrwxrwx 1 llm llm 76 6月 26 09:40 pytorch_model-00013-of-00028.bin -> ../../blobs/2927d69751954ed780094cd23c7342c188de33dc62297c6510448283de603aaa lrwxrwxrwx 1 llm llm 76 6月 26 09:44 pytorch_model-00014-of-00028.bin -> ../../blobs/53b65b4a0a2b4a3d6187174adea447da88c090ee95081230f183e90fc7aa6ecb lrwxrwxrwx 1 llm llm 76 6月 26 09:47 pytorch_model-00015-of-00028.bin -> ../../blobs/64f25743c52d3aaacd1de45bcc23e367df48e21c0099a52181497394c069c09c lrwxrwxrwx 1 llm llm 76 6月 26 09:50 pytorch_model-00016-of-00028.bin -> ../../blobs/35773f9415d00511d7981224e08ef73b0b4b252dab0cc9a1fa5c56d5a671bb3b lrwxrwxrwx 1 llm llm 76 6月 26 09:52 pytorch_model-00017-of-00028.bin -> ../../blobs/7bbd3b172fe86306d0338824cf2cec330d93ab6fbac5a60ef1b4f4d60bbdf7af lrwxrwxrwx 1 llm llm 76 6月 26 09:55 pytorch_model-00018-of-00028.bin -> ../../blobs/b26c3627cec92f3eeb876aa6610760d8f0440df0db0cef2cacecb9cc97fce74e lrwxrwxrwx 1 llm llm 76 6月 26 09:58 pytorch_model-00019-of-00028.bin -> ../../blobs/490ddcb4b3d6ca514559eb01820843dc516c0379f7a9b2473ff947074d0cf035 lrwxrwxrwx 1 llm llm 76 6月 26 10:01 pytorch_model-00020-of-00028.bin -> ../../blobs/8694ef104ecde2e006388ff2c39a0a8115ae6f8ffb65a7efe7cf843d81802977 lrwxrwxrwx 1 llm llm 76 6月 26 10:03 pytorch_model-00021-of-00028.bin -> ../../blobs/a0357d3a092a7d2706dbf55370e3348dcaa3f9b4488ccb6ba5aee5f4dffcb09c lrwxrwxrwx 1 llm llm 76 6月 26 10:06 pytorch_model-00022-of-00028.bin -> ../../blobs/0606ff197a8d2bd6856deaec399b54b8cdec76871e05f6fc2f58dd33dee5eda3 lrwxrwxrwx 1 llm llm 76 6月 26 10:09 pytorch_model-00023-of-00028.bin -> ../../blobs/a1f93ea617fe335ee65683837ea6b832064be574a52b136d2f4bb51401a1c2cf lrwxrwxrwx 1 llm llm 76 6月 26 10:20 pytorch_model-00024-of-00028.bin -> ../../blobs/f66af7e885b2bd3652aaa0a133de73ada060f6070a5ccf7fd92d8838c061be91 lrwxrwxrwx 1 llm llm 76 6月 26 10:23 pytorch_model-00025-of-00028.bin -> ../../blobs/9b815e8e8a3b5a3c58cd9552f5147186abf7994ce20b1375d0b5f6fc0423dd17 lrwxrwxrwx 1 llm llm 76 6月 26 10:25 pytorch_model-00026-of-00028.bin -> ../../blobs/8295c1a27243c062ef8d5eeb523852d24624734ee4a62e93ab2441f136752bcd lrwxrwxrwx 1 llm llm 76 6月 26 10:28 pytorch_model-00027-of-00028.bin -> ../../blobs/70b687a3df6cfa98293491aff473f8a007f9a2294cc21c249e0c14299a0c501c lrwxrwxrwx 1 llm llm 76 6月 26 10:30 pytorch_model-00028-of-00028.bin -> ../../blobs/a1dae44eef4f578cafda912abc63a332a073eb2f9680c35e84b547ef02adf9db lrwxrwxrwx 1 llm llm 52 6月 26 09:05 pytorch_model.bin.index.json -> ../../blobs/989e0277ef1827d92a36a406f7a2e609778fd833 lrwxrwxrwx 1 llm llm 52 6月 26 09:05 special_tokens_map.json -> ../../blobs/c0fc1d580b4781190e696deec8c8c6834186f7ce lrwxrwxrwx 1 llm llm 52 6月 26 09:05 tokenizer_config.json -> ../../blobs/400e3de6ffc3884ec3c158a046f6a04da00ef3ca lrwxrwxrwx 1 llm llm 76 6月 26 09:05 tokenizer.model -> ../../blobs/6fd7e445833dd0889206aba242c2a51ecbae2437fd328d1759a35475fd8c0423

shibing624 commented 1 year ago

看你的模型的下载的原版ziya delta权重,需要手动跟llama合并得到完整权重。

shibing624 commented 1 year ago

我后续发布一个合并后的权重模型,大家能直接用的吧。

dage0127 commented 1 year ago

多谢师兄。

shibing624 commented 1 year ago

release merge model: https://huggingface.co/shibing624/ziya-llama-13b-medical-merged