DLYuanGod / TinyGPT-V

TinyGPT-V: Efficient Multimodal Large Language Model via Small Backbones
BSD 3-Clause "New" or "Revised" License
1.24k stars 75 forks source link

Phi-2 problem #26

Open dexmac221 opened 8 months ago

dexmac221 commented 8 months ago

Hi everyone

Phi-2 is changed in its latest release so results are non sense strings....... the author removed pytorch_model.bin Only using previous phi-2 version (the one with bin file ) responses are good

Fortunately i have my local phi-2.....

bluesky333 commented 8 months ago

I see the same issue.

shisantaibao commented 8 months ago

Hi everyone 大家好

Phi-2 is changed in its latest release so results are non sense strings....... the author removed pytorch_model.binPhi-2 在其最新版本中进行了更改,因此结果是无意义的字符串......作者删除了 pytorch_model.bin Only using previous phi-2 version (the one with bin file ) responses are good 仅使用以前的 phi-2 版本(带有 bin 文件的版本)响应良好

Fortunately i have my local phi-2.....幸运的是我有我当地的phi-2......

Why is my output garbled? After executing the “conda_sit/envs/tinygptv/lib/python3.9/site-packages/transformers/models/phi/ Replace modeling_phi.py in that directory with the one in TinyGPT-V/modeling_phi.py.” operation, the output of Phi-2 is garbled. Phi-2 can output normally before replacing the “modeling_phi” file. 298562701-71d8e925-519a-493a-8403-97eec03d0438

IceTea42 commented 8 months ago

same here. Can someone who succeeds to get meaningful results explain the proper setup?

dysby commented 7 months ago

Hello,

currently, this repo is only compatible with susnato/phi-2 until 39bff1e6aacf5c634feb4c556e1db2cf913e2468 commit.

susnato/phi-2 huggingface repo updated the weighs after 39bff1e6aacf5c634feb4c556e1db2cf913e2468, due to changes in the transformers phi implementation (weights order is now changed to seperate q,k,v layers instead of a concatenated qkv layer) see https://huggingface.co/susnato/phi-2/discussions/4.

shisantaibao commented 7 months ago

Hi,

I noticed this problem, when I followed the operation in x to update the transformers == 4.38.0.dev0 although phi can be quizzed normally, but TinyGPT-V when not following the cp operation: modeling_phi.py /root/miniconda3/envs/tinygptv/lib/python3.9/site-packages/transformers/models/phi/, the following error occurs and does not run normally:

截屏2024-02-12 10 01 55

But after replacing modeling_phi.py as per the cp operation, it runs, but the model answers are garbled and appear to be babbling:

截屏2024-02-12 10 12 14
shisantaibao commented 7 months ago

Hi everyone:

I seem to have identified the problem, which is the current connection https://huggingface.co/susnato/phi-2 The weights have been updated and do not match the pre trained weights in the current code of Tinygpt-V, so the output of the model is nonsense. The key to solving the problem is how do we obtain the weights of the previous version of phi-2? After the official update, obtaining the weight of phi-2 from the previous version seems to be a challenge!

dysby commented 7 months ago

Hi everyone:

I seem to have identified the problem, which is the current connection https://huggingface.co/susnato/phi-2 The weights have been updated and do not match the pre trained weights in the current code of Tinygpt-V, so the output of the model is nonsense. The key to solving the problem is how do we obtain the weights of the previous version of phi-2? After the official update, obtaining the weight of phi-2 from the previous version seems to be a challenge!

Hi, clone the susnato/phi-2 repo and checkout the 39bff1e6aacf5c634feb4c556e1db2cf913e2468 commit. Or the previous one.

shisantaibao commented 7 months ago

Hi everyone: 大家好: I seem to have identified the problem, which is the current connection https://huggingface.co/susnato/phi-2 The weights have been updated and do not match the pre trained weights in the current code of Tinygpt-V, so the output of the model is nonsense. The key to solving the problem is how do we obtain the weights of the previous version of phi-2? After the official update, obtaining the weight of phi-2 from the previous version seems to be a challenge!我似乎已经找出了问题所在,就是当前连接 https://huggingface.co/susnato/phi-2 的权重已经更新,与 Tinygpt-V 当前代码中预训练的权重不匹配,所以模型的输出是无意义的。解决问题的关键是我们如何获得之前版本的phi-2的权重?官方更新后,获取之前版本的phi-2权重似乎是一个挑战!

Hi, clone the susnato/phi-2 repo and checkout the 39bff1e6aacf5c634feb4c556e1db2cf913e2468 commit. Or the previous one.您好,克隆 susnato/phi-2 存储库并签出 39bff1e6aacf5c634feb4c556e1db2cf913e2468 提交。或者是上一张。

Hi, I tried your suggestion by downloading the previous version of Phi-2 weights (including the pytorch_model. bin file), but it seems that this is not the problem with the model's nonsense. In addition, updating the version of transformers in 39bff1e6aacf5c634feb4c556e1db2cf913e2468 does not solve this problem. Now I'm a bit confused, what exactly is the problem?