@@ -115,11 +115,12 @@ def __init__(
115115 model_description = self ._get_model_description (model_name )
116116 self .cache_dir = str (define_cache_dir (cache_dir ))
117117
118+ self ._specific_model_path = specific_model_path
118119 self ._model_dir = self .download_model (
119120 model_description ,
120121 self .cache_dir ,
121122 local_files_only = self ._local_files_only ,
122- specific_model_path = specific_model_path ,
123+ specific_model_path = self . _specific_model_path ,
123124 )
124125
125126 self .token_max_length = token_max_length
@@ -160,6 +161,8 @@ def _embed_documents(
160161 documents : Union [str , Iterable [str ]],
161162 batch_size : int = 256 ,
162163 parallel : Optional [int ] = None ,
164+ local_files_only : bool = False ,
165+ specific_model_path : Optional [str ] = None ,
163166 ) -> Iterable [SparseEmbedding ]:
164167 is_small = False
165168
@@ -188,6 +191,8 @@ def _embed_documents(
188191 "language" : self .language ,
189192 "token_max_length" : self .token_max_length ,
190193 "disable_stemmer" : self .disable_stemmer ,
194+ "local_files_only" : local_files_only ,
195+ "specific_model_path" : specific_model_path ,
191196 }
192197 pool = ParallelWorkerPool (
193198 num_workers = parallel or 1 ,
@@ -226,6 +231,8 @@ def embed(
226231 documents = documents ,
227232 batch_size = batch_size ,
228233 parallel = parallel ,
234+ local_files_only = self ._local_files_only ,
235+ specific_model_path = self ._specific_model_path ,
229236 )
230237
231238 def _stem (self , tokens : list [str ]) -> list [str ]:
0 commit comments