Chinese-LLaMA-Alpaca
Chinese-LLaMA-Alpaca copied to clipboard
为什么中文的 llama 和 对应的 lora 模型没办法在 alpaca lora 中使用呢?
python generate.py
--load_8bit
--base_model '../Chinese-LLaMA-Alpaca/original_llama_7b_hf/'
--lora_weights '../Chinese-LLaMA-Alpaca/chinese-alpaca-lora-7b/'
这是 alpaca-lora 中 inference 的命令, 但我使用的都是中文的 llama 和对应中文的 lora, 理论上应该是兼容才对,但目前似乎是出现了一些问题:

最后一行已经说明问题了 词表大小不是32000
对应中文的 lora, 理论上应该是兼容才对,但目前似乎是出现了一些问题:
词表大小不是从模型配置文件加载的吗,由配置文件决定,还是说你的意思是,源代码中模型结构已经被定义了,才导致的冲突?
@airaria 哦哦,那我可能明白了,original_llama_7b_hf 是原版 llama 模型 的 hf 格式,而 LoRA 是你们提供的中文 Alpaca LoRA.
这样的话,我猜可能是扩充了原版 llama 词库原因,LoRA 对应了是扩充之后的 llama 模型,而我这里指定的是原版
@airaria 哦哦,那我可能明白了,original_llama_7b_hf 是原版 llama 模型 的 hf 格式,而 LoRA 是你们提供的中文 Alpaca LoRA.
这样的话,我猜可能是扩充了原版 llama 词库原因,LoRA 对应了是扩充之后的 llama 模型,而我这里指定的是原版
所以如果你用自己的代码加载原版llama的话,需要先resize一下model的embedding大小至49954(alpaca),然后合并Lora,并使用chinese-alpaca的tokenizer,这样应该就正常了
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration.
Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance.