Ziqing Yang

Results 212 comments of Ziqing Yang

可能是transformers的问题,也可能是模型权重的问题,目前尚不清楚,正在排查,可以参考https://github.com/oobabooga/text-generation-webui/issues/199

@ZenBuilds @jzsbioinfo Did you encounter the same problem when inferring with the original LLaMA with beam size set to 2? With command like follows ```bash python inference_hf.py --base_model path_to_llama_7b_hf --interactive...

inference_hf.py不能做多轮对话。要体验多轮对话的话请用llama.cpp或llama chat

所以问题是? 另外排版有点乱,代码部分可以放在专门的代码环境: \`\`\` python your code here \`\`\`

如果你的model加载的是合并Chinese-LLaMA-Plus-LoRA后的全量模型(`model = LlamaForCausalLM.from_pretrained("llama_weight")`),那是可以继续训练的。 不过没按你提供的代码那种方式写过,而且peft库变动也较大,提供一份示例供参考(适用于peft [13e53fc](https://github.com/huggingface/peft/tree/13e53fc)),加载alpaca_plus并继续训练LoRA(假设model已加载合并LLaMA-Plus-LoRA后的全量模型): ```python tokenizer = LlamaTokenizer.from_pretrained("alpaca_plus_7B") model.resize_token_embeddings(len(tokenizer)) # len(tokenizer)==49954 model = PeftModel.from_pretrained(model, "alpaca_plus_7B") ```

这个loss正常,而且已经比较低了。

> 我自己在继续训练的时候是从3开始下降到1.9左右开始缓慢下降了 继续训练的话从3左右开始比较符合预期。

> 请问stage1进行预训练的话,使用的是哪一个版本的预训练代码?是这个吗?run_clm_pt_with_peft.py 需要基于run_clm_pt_with_peft.py修改,删掉peft相关代码,同时设置仅embedding层(或再包含lm_head)可训练。

是的,需要把output之前的内容的label都设置成-100;tokenizer.padding_side应该始终是'right' SFT数据的处理方法建议去看下Stanford Alpaca项目中构造数据集的过程。

用peft+trainer训练时默认会保存全量权重,所以保存文件很大,处理方式可参考: https://github.com/ymcui/Chinese-LLaMA-Alpaca/blob/11e5d1fdb52aecf71c78ef6eae7c77e8b85d1537/scripts/run_clm_pt_with_peft.py#L559-L562 我们的处理方式和Stanford Alpaca一样。#269 中也提到padding_side问题,你参考一下看是否有帮助。