From bc5d11771855fc340c5e903ec050755a3350b8fa Mon Sep 17 00:00:00 2001 From: Andres Marafioti Date: Tue, 29 Sep 2026 19:44:55 +0200 Subject: [PATCH] Preserve missing-tokenizer errors in quiet mode --- scripts/build_native.py | 2 +- tests/test_build_native.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/test_build_native.py diff --git a/scripts/build_native.py b/scripts/build_native.py index 9c13b7d..d14b3de 100644 --- a/scripts/build_native.py +++ b/scripts/build_native.py @@ -119,7 +119,7 @@ def replace(match): level = "QT_LOG_WARN" elif any(word in message for word in ( "fatal", "failed", "cannot", "oom", "unsupported", - "not a valid", "no audio data", "unknown format", + "not a valid", "not found", "no audio data", "unknown format", )): level = "QT_LOG_ERROR" else: diff --git a/tests/test_build_native.py b/tests/test_build_native.py new file mode 100644 index 0000000..ef93f0d --- /dev/null +++ b/tests/test_build_native.py @@ -0,0 +1,20 @@ +"""Check diagnostics in the pinned native source after wheel-build patching.""" + +import os +from pathlib import Path +import shutil + +import pytest + +from scripts.build_native import native_diagnostic_compatibility + + +def test_missing_tokenizer_remains_an_error(tmp_path): + source = os.environ.get("QWENTTS_CPP_SOURCE") + if not source: + pytest.skip("QWENTTS_CPP_SOURCE not set") + + shutil.copytree(Path(source).resolve() / "src", tmp_path / "src") + with native_diagnostic_compatibility(tmp_path): + bpe = (tmp_path / "src" / "bpe.h").read_text() + assert 'qt_log(QT_LOG_ERROR, "[BPE] Tokenizer not found in %s", gguf_path);' in bpe