@@ -52,8 +52,7 @@ def __init__(self, model: StaticModel, head: Pipeline) -> None:
5252 def from_pretrained (
5353 cls : type [StaticModelPipeline ], path : PathLike , token : str | None = None , trust_remote_code : bool = False
5454 ) -> StaticModelPipeline :
55- """
56- Load a StaticModel from a local path or huggingface hub path.
55+ """Load a StaticModel from a local path or huggingface hub path.
5756
5857 NOTE: if you load a private model from the huggingface hub, you need to pass a token.
5958
@@ -74,8 +73,7 @@ def save_pretrained(self, path: str) -> None:
7473 def push_to_hub (
7574 self , repo_id : str , subfolder : str | None = None , token : str | None = None , private : bool = False
7675 ) -> None :
77- """
78- Save a model to a folder, and then push that folder to the hf hub.
76+ """Save a model to a folder, and then push that folder to the hf hub.
7977
8078 :param repo_id: The id of the repository to push to.
8179 :param subfolder: The subfolder to push to.
@@ -122,8 +120,7 @@ def predict(
122120 multiprocessing_threshold : int = 10_000 ,
123121 threshold : float = 0.5 ,
124122 ) -> np .ndarray :
125- """
126- Predict the labels of the input.
123+ """Predict the labels of the input.
127124
128125 :param X: The input data to predict. Can be a list of strings or a single string.
129126 :param show_progress_bar: Whether to display a progress bar during prediction. Defaults to False.
@@ -162,8 +159,7 @@ def predict_proba(
162159 use_multiprocessing : bool = True ,
163160 multiprocessing_threshold : int = 10_000 ,
164161 ) -> np .ndarray :
165- """
166- Predict the labels of the input.
162+ """Predict the labels of the input.
167163
168164 :param X: The input data to predict. Can be a list of strings or a single string.
169165 :param show_progress_bar: Whether to display a progress bar during prediction. Defaults to False.
@@ -190,8 +186,7 @@ def predict_proba(
190186 def evaluate (
191187 self , X : Sequence [str ], y : LabelType , batch_size : int = 1024 , threshold : float = 0.5 , output_dict : bool = False
192188 ) -> str | dict [str , dict [str , float ]]:
193- """
194- Evaluate the classifier on a given dataset using scikit-learn's classification report.
189+ """Evaluate the classifier on a given dataset using scikit-learn's classification report.
195190
196191 :param X: The texts to predict on.
197192 :param y: The ground truth labels.
@@ -212,8 +207,7 @@ def evaluate(
212207def _load_pipeline (
213208 folder_or_repo_path : PathLike , token : str | None = None , trust_remote_code : bool = False
214209) -> tuple [StaticModel , Pipeline ]:
215- """
216- Load a model and an sklearn pipeline.
210+ """Load a model and an sklearn pipeline.
217211
218212 This assumes the following files are present in the repo:
219213 - `pipeline.skops`: The head of the pipeline.
@@ -259,8 +253,7 @@ def _load_pipeline(
259253
260254
261255def save_pipeline (pipeline : StaticModelPipeline , folder_path : str | Path ) -> None :
262- """
263- Save a pipeline to a folder.
256+ """Save a pipeline to a folder.
264257
265258 :param pipeline: The pipeline to save.
266259 :param folder_path: The path to the folder to save the pipeline to.
@@ -296,8 +289,7 @@ def evaluate_single_or_multi_label(
296289 y : list [int ] | list [str ] | list [list [int ]] | list [list [str ]],
297290 output_dict : bool = False ,
298291) -> str | dict [str , dict [str , float ]]:
299- """
300- Evaluate the classifier on a given dataset using scikit-learn's classification report.
292+ """Evaluate the classifier on a given dataset using scikit-learn's classification report.
301293
302294 :param predictions: The predictions.
303295 :param y: The ground truth labels.
0 commit comments