Skip to content

fix: add default arg for push_to_hub #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion model2vec/inference/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def save_pretrained(self, path: str) -> None:
"""Save the model to a folder."""
save_pipeline(self, path)

def push_to_hub(self, repo_id: str, subfolder: str, token: str | None = None, private: bool = False) -> None:
def push_to_hub(
self, repo_id: str, subfolder: str | None = None, token: str | None = None, private: bool = False
) -> None:
"""
Save a model to a folder, and then push that folder to the hf hub.

Expand Down Expand Up @@ -219,6 +221,7 @@ def _load_pipeline(
"""
folder_or_repo_path = Path(folder_or_repo_path)
model_filename = _DEFAULT_MODEL_FILENAME
head_pipeline_path: str | Path
if folder_or_repo_path.exists():
head_pipeline_path = folder_or_repo_path / model_filename
if not head_pipeline_path.exists():
Expand Down