Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于继续训练(continue finetuning) #38

Closed
creamiracle opened this issue Apr 6, 2023 · 12 comments
Closed

关于继续训练(continue finetuning) #38

creamiracle opened this issue Apr 6, 2023 · 12 comments
Labels
documentation Improvements or additions to documentation

Comments

@creamiracle
Copy link

你好,感谢分享。
是否可以理解为,在垂类应用上,构造好预料,替换sh中的data_path,然后运行sh文件就能在你们分享的模型权重下继续进行训练,以得到一个应用于上述垂类语料中的模型呢?
谢谢

@Facico
Copy link
Owner

Facico commented Apr 6, 2023

@creamiracle 感谢关注。目前我们只提供了一个可以continue finetuning的接口,由于人手比较少,最近也比较忙,暂时没有在垂直领域试过。由于我们使用的是lora,理论上在垂直语料finetune过后是会挖掘llama本身在这个语料上的能力,是可以得到一个垂直语料的模型,不过对于一些没掌握的知识可能掌握的不会很理想
1、可以考虑将lora的lora_r增大,并将lora能训练的参数都加上
2、使用全量微调。不过这个显存需求就比较大。

我们后续将给出在垂直语料上训练的详细方案。

@Facico
Copy link
Owner

Facico commented Apr 11, 2023

你可以参考我们在医学问答的案例medical

@Facico Facico added the documentation Improvements or additions to documentation label Apr 11, 2023
@creamiracle
Copy link
Author

你可以参考我们在医学问答的案例medical

感谢回复,根据这个新的doc,还有几个问题想请教一下:
1.beam和penalty是在哪里设置进去的呢?
2.在无指令微调中,为什么设置了from_data_beginning=True # False
3.数据大小是20w左右,在我们之前70w的数据上训练第3个epoch,大概会训练3.5个epoch左右。这句话我不是很理解,训练第三个epoch用的70w的数据,也就是这个部分用70w数据做3个epoch的微调,然后保存checkpoint,然后继续用20w数据训练0.5个epoch么?
谢谢。

@Facico
Copy link
Owner

Facico commented Apr 20, 2023

1、这个是用于生成的参数,在generate那些推理脚本那种有
2、因为你要用新的数据,不能跳过他们
3、这里的逻辑是拼接,就是把20w的数据重复拼接3.5次

@creamiracle
Copy link
Author

1、这个是用于生成的参数,在generate那些推理脚本那种有 2、因为你要用新的数据,不能跳过他们 3、这里的逻辑是拼接,就是把20w的数据重复拼接3.5次

好的谢谢,前面我都理解了,第三个的意思是先复制20w成为70w然后再继续训练么?那为什么不能在20w上只训练一个epoch呢?

@Facico
Copy link
Owner

Facico commented Apr 23, 2023

1、不是先复制成20w(因为我们医疗问答的规模就是20w),是直接复制成70w
2、因为我们提供的优化器参数是一轮70w的,所以是直接在这个规模上提供的continue_finetune

@creamiracle
Copy link
Author

您好,我理解了,那如果我按照您的方式继续训练,也需要变成70w的数据,是这个意思吧?
2中这个参数是在哪里定义的呢?Finetuning中的trainerArguments么?
thx

@Facico
Copy link
Owner

Facico commented Apr 24, 2023

是的,如果不到70w会自动重复拼接到70w(并没有显式的拼接,而是重复了70w训练的step)
优化器参数和训练策略参数就是那几个optimizer.pt、scheduler.pt、scaler.pt等

@creamiracle
Copy link
Author

是的,如果不到70w会自动重复拼接到70w(并没有显式的拼接,而是重复了70w训练的step) 优化器参数和训练策略参数就是那几个optimizer.pt、scheduler.pt、scaler.pt等

这个自动重复拼接到70w的原理是什么呢,我对这部分不是很熟悉?烦请您解答一下,谢谢。

@Facico
Copy link
Owner

Facico commented Apr 26, 2023

就是重复训练这段数据,相当于在时间上拼接

@creamiracle
Copy link
Author

就是重复训练这段数据,相当于在时间上拼接

那就是说如果直接用这20w数据继续训练,不去复制,应该也不会报错吧

@Facico
Copy link
Owner

Facico commented Apr 27, 2023

是的

@Facico Facico closed this as completed Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants