You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(.env) (base) [root@localhost finetune]# python3 test.py
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Traceback (most recent call last):
File "/opt/ai/WisdomShell/CodeShell-7B-Chat-int4/finetune/test.py", line 8, in<module>
model = AutoModelForCausalLM.from_pretrained("output_models", trust_remote_code=True, local_files_only=True).to(device)
File "/root/anaconda3/lib/python3.9/site-packages/transformers/models/auto/auto_factory.py", line 560, in from_pretrained
return model_class.from_pretrained(
File "/root/.cache/huggingface/modules/transformers_modules/output_models/modeling_codeshell.py", line 1045, in from_pretrained
model = load_state_dict_for_qunantied_model(model, state_dict)
File "/root/.cache/huggingface/modules/transformers_modules/output_models/quantizer.py", line 257, in load_state_dict_for_qunantied_model
set_value(model, name, state_dict, is_4bit)
File "/root/.cache/huggingface/modules/transformers_modules/output_models/quantizer.py", line 212, in set_value
setattr(parent, keys[-1], state_dict[name])
File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1715, in __setattr__
raise TypeError(f"cannot assign '{torch.typename(value)}' as parameter '{name}' "
TypeError: cannot assign 'torch.BFloat16Tensor' as parameter 'weight' (torch.nn.Parameter or None expected)
The text was updated successfully, but these errors were encountered:
Jingzhenzxz
changed the title
运行微调后的COdeShell-7B-Chat-int4模型失败。
运行微调后的CodeShell-7B-Chat-int4模型失败。
Nov 4, 2023
Jingzhenzxz
changed the title
运行微调后的CodeShell-7B-Chat-int4模型失败。
运行微调后的CodeShell-7B-Chat-int4模型失败:TypeError: cannot assign 'torch.BFloat16Tensor' as parameter 'weight' (torch.nn.Parameter or None expected)
Nov 4, 2023
我准备的微调数据如下:
我运行
后得到了微调后的模型
![image](https://private-user-images.githubusercontent.com/47069834/280440135-286fbfc5-6368-4e41-a060-c686d772eedb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjY3MTEsIm5iZiI6MTczOTQ2NjQxMSwicGF0aCI6Ii80NzA2OTgzNC8yODA0NDAxMzUtMjg2ZmJmYzUtNjM2OC00ZTQxLWEwNjAtYzY4NmQ3NzJlZWRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE3MDY1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhYTJkMzk5YThjYTYxNjQ0NGMzODc3Y2M4ODhlNmMyMjI1MWUzZTVlOWVmMTZmNDE5NDUyZDc2M2RhNjkzZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.zsIoexWofGYFvDmPZQvVta-exP_GUgpRP5kQEvDPocY)
我准备了一个test.py文件,该文件指定了模型为我刚才微调后的 CodeShell-7B-Chat-int4 模型(即output_models):
我运行
后出现错误:
我把test.py中指定的模型修改为CodeShell-7B-Chat-int后再运行就没问题:
请问哪里出问题了?
我的CUDA版本是11.8,torch版本是2.1.0,TensorFlow版本是2.13.0,python版本是3.9,我的系统是centos7 x86_64,内核版本是 3.10
请大神帮帮忙,感激不尽!
The text was updated successfully, but these errors were encountered: