aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_backends_sglomni.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-02 22:53:07 -0400
committerhistoria <historiavg@proton.me>2026-09-02 22:53:07 -0400
commitd04a2c53b926ccde0d582dbf4a7360dc0f072205 (patch)
treed817622c7d32039d293c6b7d3141d40028533b96 /app/tests/test_backends_sglomni.py
parent7a7dca313750ee75e0f8a2a5442ca5d78e743294 (diff)
downloadtts-audiobook-generator-d04a2c53b926ccde0d582dbf4a7360dc0f072205.tar.gz
fix: warn before using a likely too-big chunk size for sglang-omni models
Diffstat (limited to 'app/tests/test_backends_sglomni.py')
-rw-r--r--app/tests/test_backends_sglomni.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/app/tests/test_backends_sglomni.py b/app/tests/test_backends_sglomni.py
index ebac500..8cb86cb 100644
--- a/app/tests/test_backends_sglomni.py
+++ b/app/tests/test_backends_sglomni.py
@@ -395,12 +395,24 @@ class HiggsConfigTests(unittest.TestCase):
self.assertRegex(text, r"gpu_memory_fraction:\s*0\.80")
# The engine's 2048-frame default (~27 s at 75 fps) silently
# truncates a full 250-word sub-chunk; per-request values are
- # clamped to this factory cap server-side.
- self.assertRegex(text, r"max_new_tokens:\s*12288")
+ # clamped to this factory cap server-side. 3000 frames (~40 s)
+ # is the most the pinned 4095-token admission window allows
+ # after the prompt tokens.
+ self.assertRegex(text, r"max_new_tokens:\s*3000")
def test_entry_sends_the_raised_frame_cap_per_request(self):
entry = entry_by_key("higgs_audio_v3_tts")
- self.assertEqual(entry.max_new_tokens, 12288)
+ self.assertEqual(entry.max_new_tokens, 3000)
+
+ def test_entry_caps_sub_requests_for_the_admission_window(self):
+ """The server pins prompt + generation at 4096 tokens for Higgs;
+ 80 words (~30-40 s at 75 fps) narrates inside the 3000-frame
+ cap, and the pre-flight popup offers the clamp for a run."""
+ entry = entry_by_key("higgs_audio_v3_tts")
+ self.assertEqual(entry.chunk_words, 80)
+ # A full CHUNK_SIZE sub-chunk does NOT fit one Higgs request.
+ self.assertLess(entry.chunk_words, 250)
+ self.assertIsNone(entry_by_key("zonos2").chunk_words)
class Fp8FallbackTests(unittest.TestCase):