Skip to content

Commit

Permalink
Update SaveAxolotlConfigtoWandBCallback to use artifact instead of sa…
Browse files Browse the repository at this point in the history
…ve (#1483)

* deprecated wandb.save

* also use wandb.save for axolotl yaml

* chore: lint

---------

Co-authored-by: Wing Lian <[email protected]>
  • Loading branch information
tcapelle and winglian authored Apr 9, 2024
1 parent da9b1a3 commit 5ed2939
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/axolotl/utils/callbacks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,11 @@ def on_train_begin(
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."
Expand Down

0 comments on commit 5ed2939

Please sign in to comment.