赞
踩
原始保存代码为:
quant_path = "baichuan2_awq"
torch.save(model.state_dict(), quant_path)
报错如下:
RuntimeError: File baichuan2_awq cannot be opened
解决方法:需要保存的文件名字为"pytorch_model.bin"
import os
quant_path = "baichuan2_awq"
model_path = os.path.join(quant_path, "pytorch_model"+".bin")
torch.save(model.state_dict(), model_path)
问题解决
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。