From c293cc90f69748cdcfd2b5f16613cf6b21b38402 Mon Sep 17 00:00:00 2001 From: Artem Akymenko Date: Wed, 29 Jul 2026 11:26:43 +0000 Subject: [PATCH] chore: suppress phonemizer word-count-mismatch warnings (normal behavior) --- abogen/webui/app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/abogen/webui/app.py b/abogen/webui/app.py index c79aac1..7754519 100644 --- a/abogen/webui/app.py +++ b/abogen/webui/app.py @@ -29,6 +29,13 @@ class _SuppressSuccessfulAccessFilter(logging.Filter): return " 200 " not in message and " 201 " not in message and " 204 " not in message +class _SuppressPhonemizerWarnings(logging.Filter): + """Suppress phonemizer word-count-mismatch warnings (normal behavior).""" + + def filter(self, record: logging.LogRecord) -> bool: # pragma: no cover - small utility + return "words count mismatch" not in record.getMessage() + + _access_log_filter_attached = False @@ -123,6 +130,7 @@ def create_app(config: Optional[dict[str, Any]] = None) -> Flask: global _access_log_filter_attached if not _access_log_filter_attached: logging.getLogger("werkzeug").addFilter(_SuppressSuccessfulAccessFilter()) + logging.getLogger("phonemizer").addFilter(_SuppressPhonemizerWarnings()) _access_log_filter_attached = True return app