Skip to content

Commit 44c52a5

Browse files
committed
🔨 **test(test_real_detection): Raise error for non-memory model load failures**
Update test to ensure non-memory errors raise `DetectError` instead of falling back to a smaller model. 📝 **docs(README): Clarify fallback behavior and add language code mapping guide** Explain conditions for model fallback and provide guidance on mapping language codes to English names using `langcodes`.
1 parent a50fc79 commit 44c52a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/fast_langdetect/infer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _preprocess_text(self, text: str) -> str:
262262

263263
# Auto-truncate overly long input if configured
264264
if self.config.max_input_length is not None and len(text) > self.config.max_input_length:
265-
logger.warning(
265+
logger.info(
266266
f"fast-langdetect: Truncating input from {len(text)} to {self.config.max_input_length} characters; may reduce accuracy."
267267
)
268268
text = text[: self.config.max_input_length]

0 commit comments

Comments
 (0)