@@ -168,7 +168,7 @@ class LangDetectConfig:
168
168
Configuration for language detection.
169
169
170
170
:param cache_dir: Directory for storing downloaded models
171
- :param model_path : Path to custom model file (if using own model)
171
+ :param custom_model_path : Path to custom model file (if using own model)
172
172
:param proxy: HTTP proxy for downloads
173
173
:param allow_fallback: Whether to fallback to small model
174
174
:param disable_verify: Whether to disable MD5 verification
@@ -177,21 +177,21 @@ class LangDetectConfig:
177
177
def __init__ (
178
178
self ,
179
179
cache_dir : Optional [str ] = None ,
180
- model_path : Optional [str ] = None ,
180
+ custom_model_path : Optional [str ] = None ,
181
181
proxy : Optional [str ] = None ,
182
182
allow_fallback : bool = True ,
183
183
disable_verify : bool = False ,
184
184
verify_hash : Optional [str ] = None ,
185
185
):
186
186
self .cache_dir = cache_dir or CACHE_DIRECTORY
187
- self .model_path = model_path
187
+ self .custom_model_path = custom_model_path
188
188
self .proxy = proxy
189
189
self .allow_fallback = allow_fallback
190
190
# Only verify large model
191
191
self .disable_verify = disable_verify
192
192
self .verify_hash = verify_hash
193
- if self .model_path and not Path (self .model_path ).exists ():
194
- raise FileNotFoundError (f"fast-langdetect: Target model file not found: { self .model_path } " )
193
+ if self .custom_model_path and not Path (self .custom_model_path ).exists ():
194
+ raise FileNotFoundError (f"fast-langdetect: Target model file not found: { self .custom_model_path } " )
195
195
196
196
class LangDetector :
197
197
"""Language detector using FastText models."""
@@ -214,11 +214,11 @@ def _get_model(self, low_memory: bool = True) -> Any:
214
214
return model
215
215
216
216
try :
217
- if self .config .model_path is not None :
217
+ if self .config .custom_model_path is not None :
218
218
# Load Custom Model
219
219
if self .config .disable_verify :
220
220
self .config .verify_hash = None
221
- model = self ._model_loader .load_local (Path (self .config .model_path ))
221
+ model = self ._model_loader .load_local (Path (self .config .custom_model_path ))
222
222
elif low_memory is True :
223
223
self .config .verify_hash = None
224
224
# Load Small Model
0 commit comments