feat: add swanlab for experiment tracking and visualization. #6401
+224
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before submitting
如何在LLaMA Factory中使用SwanLab?
SwanLab 是一个开源的模型训练记录工具,面向AI研究者,提供了训练可视化、自动日志记录、超参数记录、实验对比、多人协同等功能。在SwanLab上,研究者能基于直观的可视化图表发现训练问题,对比多个实验找到研究灵感,并通过在线链接的分享与基于组织的多人协同训练,打破团队沟通的壁垒。
为什么要记录训练
相较于软件开发,模型训练更像一个实验科学。一个品质优秀的模型背后,往往是成千上万次实验。研究者需要不断尝试、记录、对比,积累经验,才能找到最佳的模型结构、超参数与数据配比。在这之中,如何高效进行记录与对比,对于研究效率的提升至关重要。
在LLaMA Factory中使用
方式一:CLI
在yaml配置文件中,增加如下代码(注释的部分,代表选填):
然后CLI启动命令即可:
方式二:WebUI
启动WebUI:
在GUI中对应栏位填写参数后,启动训练后,在系统的命令行打印中找到SwanLab实验链接访问即可:
备注
SwanLab API Key如何获取
在官网或备用官网注册/登录账号,在设置中找到API Key。
如果你使用local模式,则无需 API Key。
一些交互上的想法
如果在「SwanLab 参数设置」选项卡中,能够增加一个按钮,点击跳转到对应的SwanLab链接,那用户体验就更好了:),暂时在开发上不知道要怎么写。
获取链接的代码: