ymcui / Chinese-LLaMA-Alpaca-2

中文LLaMA-2 & Alpaca-2大模型二期项目 + 64K超长上下文模型 (Chinese LLaMA-2 & Alpaca-2 LLMs with 64K long context models)
Apache License 2.0
7k stars 570 forks source link

请问本仓库能否基于YaRN进行sft? #524

Closed Zheng-Jay closed 3 months ago

Zheng-Jay commented 4 months ago

提交前必须检查以下项目

问题类型

模型训练与精调

基础模型

Chinese-Alpaca-2 (7B/13B)

操作系统

Linux

详细描述问题

感谢贵团队的开源贡献! YaRN仓库开源了训练代码,但只支持预训练,我想进行sft阶段的外推训练,将instruct版本从4k外推到16k,看到alpaca2仓库日志里写道支持YaRN模型,翻遍了wiki和issue都没找到YaRN训练相关的,是只支持推理而已吗?

依赖情况(代码类问题务必提供)

# 请在此处粘贴依赖情况(请粘贴在本代码块里)

运行日志或截图

# 请在此处粘贴运行日志(请粘贴在本代码块里)
iMountTai commented 4 months ago

目前仓库内训练代码确实没有适配YaRN训练,可以自行修改代码以支持,将sft-405LlamaForCausalLM改成从自定义模型文件import再调试试试,或者添加trust_remote_code=True参数。

Zheng-Jay commented 4 months ago

目前仓库内训练代码确实没有适配YaRN训练,可以自行修改代码以支持,将sft-405LlamaForCausalLM改成从自定义模型文件import再调试试试,或者添加trust_remote_code=True参数。

好的,我看YaRN有自定义的Llama模型类,除了把替换进去,还有其他需要修改的吗? 另外trust_remote_code=True不是在从hf上下载模型时才用到么,在这里需要用到吗?

iMountTai commented 4 months ago

trust_remote_code参数就是用来使用自定义模型类的,直接使用第一种方案吧(替换模型类)

github-actions[bot] commented 4 months ago

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.

github-actions[bot] commented 3 months ago

Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance.