Skip to content

Commit 562c14d

Browse files
authored
fix: add default arg for push_to_hub (MinishLab#240)
1 parent 647fa80 commit 562c14d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

model2vec/inference/model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def save_pretrained(self, path: str) -> None:
6565
"""Save the model to a folder."""
6666
save_pipeline(self, path)
6767

68-
def push_to_hub(self, repo_id: str, subfolder: str, token: str | None = None, private: bool = False) -> None:
68+
def push_to_hub(
69+
self, repo_id: str, subfolder: str | None = None, token: str | None = None, private: bool = False
70+
) -> None:
6971
"""
7072
Save a model to a folder, and then push that folder to the hf hub.
7173
@@ -219,6 +221,7 @@ def _load_pipeline(
219221
"""
220222
folder_or_repo_path = Path(folder_or_repo_path)
221223
model_filename = _DEFAULT_MODEL_FILENAME
224+
head_pipeline_path: str | Path
222225
if folder_or_repo_path.exists():
223226
head_pipeline_path = folder_or_repo_path / model_filename
224227
if not head_pipeline_path.exists():

0 commit comments

Comments
 (0)