AI4Finance-Foundation / FinGPT

FinGPT: Open-Source Financial Large Language Models! Revolutionize 🔥 We release the trained model on HuggingFace.
https://ai4finance.org
MIT License
13.84k stars 1.92k forks source link

FinGPT-v1,执行finetune.sh 脚本,生成的output_dir目录缺少文件 #44

Open xiaozhao1795 opened 1 year ago

xiaozhao1795 commented 1 year ago

我在运行finetune.sh脚本的时候,没有报错,生成的output_dir目录如下

image

只有这两个文件,缺少config.json 是什么原因。谢谢

oliverwang15 commented 1 year ago

正常的运行后,保存的就是这两个文件呀。请问您”缺少config.json”是在什么情况下遇到的呢。

After normal operation, these two files are the exact files that are saved. May I ask under what circumstances you encounter "missing config.json"?

xiaozhao1795 commented 1 year ago

正常的运行后,保存的就是这两个文件呀。请问您”缺少config.json”是在什么情况下遇到的呢。

After normal operation, these two files are the exact files that are saved. May I ask under what circumstances you encounter "missing config.json"?

我在加载模型使用checkpoint的时候,使用下面的方式 model = AutoModel.from_pretrained(model_args.model_name_or_path, config=config, trust_remote_code=True) prefix_state_dict = torch.load(os.path.join(model_args.ptuning_checkpoint, "adapter_model.bin")) new_prefix_state_dict = {} for k, v in prefix_state_dict.items(): if k.startswith("transformer.prefix_encoder."): new_prefix_state_dict[k[len("transformer.prefix_encoder."):]] = v model.transformer.prefix_encoder.load_state_dict(new_prefix_state_dict)

应该是我加载错了