Facico / Chinese-Vicuna

Chinese-Vicuna: A Chinese Instruction-following LLaMA-based Model —— 一个中文低资源的llama+lora方案,结构参考alpaca
https://github.com/Facico/Chinese-Vicuna
Apache License 2.0
4.14k stars 422 forks source link

Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco这个模型是怎么训练出来的 #87

Closed hyb1234hi closed 1 year ago

hyb1234hi commented 1 year ago

本人第一次接触这类项目,请问文档里的Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco这个模型是怎么训练出来的,finetune.py的输出又是什么,checkpoint-final是什么,和13B-based lora model什么关系。另外CPU推理的tools/merge_lora_for_cpp.py这个文件也没有。可以从huggingface上加载我们的模型或其他lora模型,为什么文件名是generate.py,需要generate生成什么呢?断点重训/增量训练支不支持单卡写法呢?哪些是你们自己训练的或是三方的,哪些是我们需要我们自己可以训练的呢?

Facico commented 1 year ago

1、用我们的finetune脚本,把DATA_PATH设置成下载后的merge.json跑出来的 2、finetune.py输出模型 3、checkpoint-final就是Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco,和13B-based lora model没有关系 4、merge_lora_for_cpp.py名字改为merge_lora.py了,这个我等下去改文档 5、generate就是推理用的,根据输入生成输出 6、支持 7、那些lora模型都是我们训练的,lora模型是我们可以训练的

hyb1234hi commented 1 year ago

感谢回答 3.13B-based lora model我们这边也可以训练出来么。

  1. generate的输入model_path是https://huggingface.co/decapoda-research/llama-7b-hf么,那么lora_path对应的是Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco么,还是lora_path只是个输出路径。
  2. 断点重训/增量训练单卡写法是什么。
  3. 我们可以训练哪些呢。
Facico commented 1 year ago

3、都可以,7b,13b,30b等把基底模型改一下都能训 5、model_path是基底模型,可以仔细阅读我们的readme和相关的脚本 6、和finetune.sh的单卡写法一致 7、你的问题有点抽象

hyb1234hi commented 1 year ago

也就是你们的代码是 1.参考https://github.com/tloen/alpaca-lora。 2.使用decapoda-research/llama-7b-hf,merge.json作为输入,然后利用finetune.py脚本,训练出类似Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco的模型。 3.最后用类似Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco的模型和decapoda-research/llama-7b-hf作为输入,然后用对话脚本使用gradio生成一个网页(用于指令问答)的项目呗。

Facico commented 1 year ago

最基础的流程可以这么理解

hyb1234hi commented 1 year ago

感谢回答