HarderThenHarder / transformers_tasks

⭐️ NLP Algorithms with transformers lib. Supporting Text-Classification, Text-Generation, Information-Extraction, Text-Matching, RLHF, SFT etc.
https://www.zhihu.com/column/c_1451236880973426688
2.11k stars 376 forks source link

最新更新代码后,模型训练保存出错 #39

Closed nieallen closed 1 year ago

nieallen commented 1 year ago

AttributeError: 'PeftModelForCausalLM' object has no attribute 'merge_and_unload' AttributeError: 'LoraModel' object has no attribute 'merge_and_unload' image

HarderThenHarder commented 1 year ago

Hi,您需要重新更新一下 peft 的包:

pip uninstall peft
cd peft-chatglm
python setup.py install
nieallen commented 1 year ago

Hi,您需要重新更新一下 peft 的包:

pip uninstall peft
cd peft-chatglm
python setup.py install

谢谢,已解决,请问为什么lora训练,模型文件保存这么大?这会使得磁盘空间占用很大

HarderThenHarder commented 1 year ago

考虑到推理速度和模型稳定性,我在存储模型的时候将 LoRA 参数和原始模型进行了合并,这样可以得到一个完整的原始模型。

nieallen commented 1 year ago

考虑到推理速度和模型稳定性,我在存储模型的时候将 LoRA 参数和原始模型进行了合并,这样可以得到一个完整的原始模型。

get