Skip to content
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