tatsu-lab / stanford_alpaca

Code and documentation to train Stanford's Alpaca models, and generate the data.
https://crfm.stanford.edu/2023/03/13/alpaca.html
Apache License 2.0
29.39k stars 4.03k forks source link

weight_diff.py state_dict_recovered[key].add_(state_dict_raw[key]) RuntimeError: The size of tensor a (32001) must match the size of tensor b (32000) at non-singleton dimension 0 #304

Open gaodexiaozheng opened 10 months ago

gaodexiaozheng commented 10 months ago

when running the below commend: python weight_diff.py recover --path_raw /models/Llama-2-7b-hf --path_diff /models/alpaca-7b-wdiff --path_tuned ./llama-alpaca-7b-hf

it shows the error: RuntimeError: The size of tensor a (32001) must match the size of tensor b (32000) at non-singleton dimension 0

though I can understand this error, this should be resolved.

boyue-jiang commented 10 months ago

I encountered the same problem. When I check the source code, I found that relates to the format of the model.state_dict. So you should check the state_dict shape of the raw model and model diff.

Irenehere commented 8 months ago

I have the same problem. Any idea to solve this error?

Yclock commented 3 months ago

I have the same problem. Any idea to solve this error? Hi, have you solved this error?