From 5ed29393e34cf57b24a20ac1bafa3a94272ac3f5 Mon Sep 17 00:00:00 2001 From: Thomas Capelle Date: Wed, 10 Apr 2024 00:58:38 +0200 Subject: [PATCH] Update SaveAxolotlConfigtoWandBCallback to use artifact instead of save (#1483) * deprecated wandb.save * also use wandb.save for axolotl yaml * chore: lint --------- Co-authored-by: Wing Lian --- src/axolotl/utils/callbacks/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/axolotl/utils/callbacks/__init__.py b/src/axolotl/utils/callbacks/__init__.py index d907e3f6a..fbc1dcfad 100644 --- a/src/axolotl/utils/callbacks/__init__.py +++ b/src/axolotl/utils/callbacks/__init__.py @@ -761,6 +761,11 @@ class SaveAxolotlConfigtoWandBCallback(TrainerCallback): mode="w", delete=False, suffix=".yml", prefix="axolotl_config_" ) as temp_file: copyfile(self.axolotl_config_path, temp_file.name) + artifact = wandb.Artifact( + f"config-{wandb.run.id}", type="axolotl-config" + ) + artifact.add_file(temp_file.name) + wandb.log_artifact(artifact) wandb.save(temp_file.name) LOG.info( "The Axolotl config has been saved to the WandB run under files."