|
14 | 14 | from sklearn.pipeline import Pipeline |
15 | 15 | from sklearn.preprocessing import MultiLabelBinarizer |
16 | 16 |
|
17 | | -from model2vec.hf_utils import _create_model_card |
18 | 17 | from model2vec.model import PathLike, StaticModel |
| 18 | +from model2vec.modelcards import create_model_card |
19 | 19 |
|
20 | 20 | _DEFAULT_TRUST_PATTERN = re.compile(r"sklearn\..+") |
21 | 21 | _DEFAULT_MODEL_FILENAME = "pipeline.skops" |
@@ -77,7 +77,7 @@ def push_to_hub( |
77 | 77 | :param token: The token to use to push to the hub. |
78 | 78 | :param private: Whether the repository should be private. |
79 | 79 | """ |
80 | | - from model2vec.hf_utils import push_folder_to_hub |
| 80 | + from model2vec.persistence import push_folder_to_hub |
81 | 81 |
|
82 | 82 | with TemporaryDirectory() as temp_dir: |
83 | 83 | save_pipeline(self, temp_dir) |
@@ -266,11 +266,11 @@ def save_pipeline(pipeline: StaticModelPipeline, folder_path: str | Path) -> Non |
266 | 266 | name = base_model_name |
267 | 267 | else: |
268 | 268 | name = "unknown" |
269 | | - _create_model_card( |
| 269 | + create_model_card( |
270 | 270 | folder_path, |
271 | 271 | base_model_name=name, |
272 | 272 | language=pipeline.model.language, |
273 | | - template_path="modelcards/classifier_template.md", |
| 273 | + template_path="classifier_template.md", |
274 | 274 | ) |
275 | 275 |
|
276 | 276 |
|
@@ -310,7 +310,7 @@ def evaluate_single_or_multi_label( |
310 | 310 | y_transformed, |
311 | 311 | predictions_transformed, |
312 | 312 | output_dict=output_dict, |
313 | | - zero_division=0, |
| 313 | + zero_division=0, # type: ignore # incorrect type in sklearn. |
314 | 314 | ) |
315 | 315 |
|
316 | 316 | return report |
0 commit comments