-
获取Chinese-LLaMA-Alpaca的基座模型
- 首先,获得Chinese-LLaMA-Alpaca的GitHub页面上的基座模型。
- 我们的GuwenLLAMA基于Chinese-Alpaca-Pro-1python scripts/merge_llama_with_chinese_lora.py
--base_model Chinese-Alpaca-Pro-13B
--lora_model lora_from_this_page
--output_type huggingface
--output_dir path_to_output_dir3B进行了微调,以下是具体的获取方法:
- 获取原生的13B LLaMA模型,由于版权原因,我们这里不提供下载链接。
- 在Chinese-LLaMA-Alpaca项目的推荐模型下载部分中,选择下载
Chinese-LLaMA-Plus-13B
和Chinese-Alpaca-Pro-13B
这两个模型。 - 在Chinese-LLaMA-Alpaca项目的合并模型部分,
将刚才下载的原生LLaMA-13B、Chinese-LLaMA-Plus-13B和Chinese-Alpaca-Pro-13B这三个模型进行合并。合并方法请参考上述链接。
a. 将原版LLaMA模型转换为Hugging Face (HF)格式(如果您下载的原生LLaMA-13B不是HF格式)。
b. 合并LoRA权重,生成全量模型权重,这里同样需要合并成HF格式。
python scripts/merge_llama_with_chinese_lora.py \ --base_model 原生LLaMA-13B \ --lora_model Chinese-LLaMA-Plus-13B , Chinese-Alpaca-Pro-13B \ --output_type huggingface \ --output_dir path_to_output_dir
-
通过上述步骤,您已经获得了Chinese-Alpaca-Pro-13B模型,这就是我们任务所使用的基座模型。
-
接下来,需要将GuwenLLAMA的LoRA模型与Chinese-Alpaca-Pro-13B合并。
python scripts/merge_llama_with_chinese_lora.py --base_model Chinese-Alpaca-Pro-13B --lora_model lora_from_this_page --output_type huggingface --output_dir path_to_output_dir
通过这一步,您就获得了可使用的GuwenLLAMA模型。
- 现在,您可以开始使用GuwenLLAMA进行推理。有关推理方法,请参考项目的相关描述:GuwenLLAMA GitHub页面