[tracking] fix swanlab hparams (#8532)

Co-authored-by: Yaowei Zheng <hiyouga@buaa.edu.cn>
This commit is contained in:
Ze-Yi LIN 2025-07-02 22:08:44 +08:00 committed by GitHub
parent e117e3c2b7
commit 8e7727f4ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,6 +164,9 @@ def _check_extra_dependencies(
if finetuning_args.use_adam_mini:
check_version("adam-mini", mandatory=True)
if finetuning_args.use_swanlab:
check_version("swanlab", mandatory=True)
if finetuning_args.plot_loss:
check_version("matplotlib", mandatory=True)
@ -345,6 +348,9 @@ def get_train_args(args: Optional[Union[dict[str, Any], list[str]]] = None) -> _
if finetuning_args.finetuning_type == "lora":
# https://github.com/huggingface/transformers/blob/v4.50.0/src/transformers/trainer.py#L782
training_args.label_names = training_args.label_names or ["labels"]
if "swanlab" in training_args.report_to and finetuning_args.use_swanlab:
training_args.report_to.remove("swanlab")
if (
training_args.parallel_mode == ParallelMode.DISTRIBUTED