Skip to content

Commit

Permalink
Use model
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsRogge committed Mar 4, 2024
1 parent 5b48a2e commit 2849871
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/huggingface_hub/hub_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ class PyTorchModelHubMixin(ModelHubMixin):
def _save_pretrained(self, save_directory: Path) -> None:
"""Save weights from a Pytorch model to a local directory."""
model_to_save = self.module if hasattr(self, "module") else self # type: ignore
save_model(model_to_save.state_dict(), save_directory / SAFETENSORS_SINGLE_FILE)
save_model(model_to_save, save_directory / SAFETENSORS_SINGLE_FILE)

@classmethod
def _from_pretrained(
Expand Down

0 comments on commit 2849871

Please sign in to comment.