aboutsummaryrefslogtreecommitdiff
path: root/app/tests
diff options
context:
space:
mode:
Diffstat (limited to 'app/tests')
-rw-r--r--app/tests/test_backends_sglomni.py30
-rw-r--r--app/tests/test_tts_sglomni.py9
2 files changed, 36 insertions, 3 deletions
diff --git a/app/tests/test_backends_sglomni.py b/app/tests/test_backends_sglomni.py
index 1fd5f5a..ebac500 100644
--- a/app/tests/test_backends_sglomni.py
+++ b/app/tests/test_backends_sglomni.py
@@ -330,10 +330,12 @@ class BuildSpecTests(unittest.TestCase):
self.assertEqual(port_flag, "--port")
self.assertIn(port, str(spec.url))
- def test_spec_omits_config_when_none_needed(self):
+ def test_spec_launches_the_higgs_config(self):
entry = entry_by_key("higgs_audio_v3_tts")
spec = status.build_spec(entry)
- self.assertNotIn("--config", spec.argv)
+ self.assertIn("--config", spec.argv)
+ self.assertEqual(Path(spec.argv[spec.argv.index("--config") + 1]),
+ catalog.config_path(entry))
class GpuCapabilityTests(unittest.TestCase):
@@ -377,6 +379,30 @@ class GpuCapabilityTests(unittest.TestCase):
self.assertIsNone(status.gpu.compute_capability())
+class HiggsConfigTests(unittest.TestCase):
+ """The vendored Higgs config: VRAM headroom and a raised frame cap."""
+
+ def test_config_declares_the_repo_budget_and_frame_cap(self):
+ entry = entry_by_key("higgs_audio_v3_tts")
+ path = catalog.config_path(entry)
+ self.assertIsNotNone(path)
+ self.assertTrue(path.is_file(), f"missing {path}")
+ text = path.read_text(encoding="utf-8")
+ self.assertIn(f"model_path: {entry.repo}", text)
+ # The upstream pipeline budgets 0.98 of the card across its
+ # colocated stages; 0.80 leaves transient-allocation headroom on
+ # 24 GB cards (request-time CUDA OOM at the 0.85 default).
+ 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")
+
+ 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)
+
+
class Fp8FallbackTests(unittest.TestCase):
"""FP8-only pipelines fall back to a vendored bf16 config on old GPUs."""
diff --git a/app/tests/test_tts_sglomni.py b/app/tests/test_tts_sglomni.py
index 58ca57c..85327e1 100644
--- a/app/tests/test_tts_sglomni.py
+++ b/app/tests/test_tts_sglomni.py
@@ -254,8 +254,15 @@ class PayloadTests(unittest.TestCase):
payload = client._request_payload("Hello.")
self.assertEqual(payload["max_new_tokens"], 12288)
- def test_models_without_a_cap_send_no_max_new_tokens(self):
+ def test_higgs_payload_raises_the_generation_cap(self):
+ """Higgs's 2048-frame engine default caps a request at ~27 s
+ (75 fps), below a full 250-word sub-chunk."""
client = self._make_client("higgs_audio_v3_tts")
+ payload = client._request_payload("Hello.")
+ self.assertEqual(payload["max_new_tokens"], 12288)
+
+ def test_models_without_a_cap_send_no_max_new_tokens(self):
+ client = self._make_client("moss_tts")
self.assertNotIn("max_new_tokens",
client._request_payload("Hello."))