Skip to content
Open
Show file tree
Hide file tree
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
277 changes: 0 additions & 277 deletions model2vec/hf_utils.py

This file was deleted.

10 changes: 5 additions & 5 deletions model2vec/inference/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MultiLabelBinarizer

from model2vec.hf_utils import _create_model_card
from model2vec.model import PathLike, StaticModel
from model2vec.modelcards import create_model_card

_DEFAULT_TRUST_PATTERN = re.compile(r"sklearn\..+")
_DEFAULT_MODEL_FILENAME = "pipeline.skops"
Expand Down Expand Up @@ -77,7 +77,7 @@ def push_to_hub(
:param token: The token to use to push to the hub.
:param private: Whether the repository should be private.
"""
from model2vec.hf_utils import push_folder_to_hub
from model2vec.persistence import push_folder_to_hub

with TemporaryDirectory() as temp_dir:
save_pipeline(self, temp_dir)
Expand Down Expand Up @@ -266,11 +266,11 @@ def save_pipeline(pipeline: StaticModelPipeline, folder_path: str | Path) -> Non
name = base_model_name
else:
name = "unknown"
_create_model_card(
create_model_card(
folder_path,
base_model_name=name,
language=pipeline.model.language,
template_path="modelcards/classifier_template.md",
template_path="classifier_template.md",
)


Expand Down Expand Up @@ -310,7 +310,7 @@ def evaluate_single_or_multi_label(
y_transformed,
predictions_transformed,
output_dict=output_dict,
zero_division=0,
zero_division=0, # type: ignore # incorrect type in sklearn.
)

return report
Loading