Skip to content

Commit

Permalink
Bugfix: WandbCallback uploads initial model checkpoint (#30897)
Browse files Browse the repository at this point in the history
* fix wandb always uploading initial model

* Update comment.

* Optionally log initial model

* Revert "Optionally log initial model"

This reverts commit 9602cc1.
  • Loading branch information
mgerstgrasser authored May 23, 2024
1 parent 6d3d5b1 commit 6657fb5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transformers/integrations/integration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def setup(self, args, state, model, **kwargs):
except AttributeError:
logger.info("Could not log the number of model parameters in Weights & Biases.")

# log the initial model and architecture to an artifact
# log the initial model architecture to an artifact
with tempfile.TemporaryDirectory() as temp_dir:
model_name = (
f"model-{self._wandb.run.id}"
Expand All @@ -813,7 +813,6 @@ def setup(self, args, state, model, **kwargs):
"initial_model": True,
},
)
model.save_pretrained(temp_dir)
# add the architecture to a separate text file
save_model_architecture_to_file(model, temp_dir)

Expand Down

0 comments on commit 6657fb5

Please sign in to comment.