Moses Hu
Moses Hu
> 我们之前尝试用add_token方法来扩张词汇表发现会切分出许多多余的空格; 如果你没有出现此问题,可以尝试继续用add_token方法扩张词汇表,理论上对训练embedding没有影响 确实啊,在decode的时候句子中会出现空格
就是个gpt的模型,还是用llama吧
https://github.com/OpenLMLab/MOSS/blob/main/models/modeling_moss.py. I think it's only decoder.very common architecture
@yuanconghao I solevd this error by increasing cpu memory.
> 更新peft到最新版本么0.3.0.dev0么?
@eeric did you solve this error? my pytorch version is 1.13.1+cuda11.7 . I got the same error .
> ``` config = LoraConfig.LoraConfig.from_pretrained("adpater_config_dir") model = LlamaForCausalLM.from_pretrained("llama_weight") tokenizer = LlamaTokenizer.from_pretrained("alpaca_plus_7B") model.resize_token_embeddings(len(tokenizer)) model = get_peft_model(model, config) adapters_weights = torch.load("lora_ch/adapter_model.bin") model = set_peft_model_state_dict(model, adapters_weights) ``` 我的意思是我用上的代码在alpaca-plus的基础上训练是可以的吧?
> 如果你的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") > ``` 好的
> 是的,需要把output之前的内容的label都设置成-100;tokenizer.padding_side应该始终是'right' SFT数据的处理方法建议去看下Stanford Alpaca项目中构造数据集的过程。 好的
> 是的,需要把output之前的内容的label都设置成-100;tokenizer.padding_side应该始终是'right' SFT数据的处理方法建议去看下Stanford Alpaca项目中构造数据集的过程。 我按照这种方式去训练的时候,生成的 checkpoint中的pytorch_model.bin比较大,13G,把output前面mask成-100,效果很不好,几乎只预测出instruction 的部分,这是因为模型还没学习到后面的结果么?能不能参考你们在训练alpaca的时候怎么处理数据的?