Integrate YuE2 as an exclusive Athena mode

This commit is contained in:
Mikei386
2026-09-10 23:53:19 +02:00
parent 5c34afa7fa
commit f2052adb78
14 changed files with 278 additions and 15 deletions
+16
View File
@@ -80,6 +80,13 @@ class DashboardModeTests(unittest.TestCase):
self.assertEqual(body, {"status": "accepted"})
self.assertEqual(json.loads(urlopen.call_args.args[0].data), {"mode": "applio"})
def test_yue2_mode_is_forwarded_to_router(self):
with patch.object(self.dashboard.urllib.request, "urlopen", return_value=_Response()) as urlopen:
status, body = self.dashboard.change_mode("yue2")
self.assertEqual(status, 202)
self.assertEqual(body, {"status": "accepted"})
self.assertEqual(json.loads(urlopen.call_args.args[0].data), {"mode": "yue2"})
def test_unknown_mode_is_rejected_without_router_request(self):
with patch.object(self.dashboard.urllib.request, "urlopen") as urlopen:
status, body = self.dashboard.change_mode("unknown")
@@ -104,6 +111,15 @@ class DashboardModeTests(unittest.TestCase):
self.assertIn("http://192.168.1.212:8011/", html)
self.assertIn("http://192.168.1.212:8012/", html)
def test_dashboard_keeps_ace_step_and_offers_yue2_separately(self):
html = self.dashboard.HTML
self.assertIn("ACE-Step Studio", html)
self.assertIn("YuE2 Studio", html)
self.assertIn("setMode('music')", html)
self.assertIn("setMode('yue2')", html)
self.assertIn("http://192.168.1.212:8014/", html)
def test_dashboard_lists_only_portable_encrypted_backups(self):
valid = self.backup_dir / "athena-portable-2026-09-10T10-00-00Z.tar.zst.age"
valid.write_bytes(b"encrypted")
+29
View File
@@ -41,6 +41,11 @@ def music_item(state="exited"):
"Labels": {controller.MUSIC_LABEL_KEY: "acestep"}}
def yue2_item(state="exited"):
return {"Id": "id-yue2", "State": state,
"Labels": {controller.MUSIC_LABEL_KEY: "yue2"}}
def separator_item(state="exited"):
return {"Id": "id-separator", "State": state,
"Labels": {controller.SEPARATOR_LABEL_KEY: "bs-roformer"}}
@@ -57,6 +62,30 @@ def voice_change_item(state="exited"):
class ProfileControllerTests(unittest.TestCase):
def test_yue2_start_exclusively_stops_llm_and_ace_step(self):
profiles = {name: item(name) for name in controller.ALLOWED}
profiles["ultra"] = item("ultra", "running")
calls = []
def request(method, path):
calls.append((method, path))
return 204, b""
with patch.object(controller, "YUE2_WORKER", "yue2"), \
patch.object(controller, "MUSIC_WORKER", "acestep"), \
patch.object(controller, "containers", return_value=profiles), \
patch.object(controller, "yue2_container", return_value=yue2_item()), \
patch.object(controller, "music_container", return_value=music_item("running")), \
patch.object(controller, "image_containers", return_value=[image_item("running")]), \
patch.object(controller, "tts_container", return_value=tts_item()), \
patch.object(controller, "docker_request", side_effect=request):
result = controller.set_yue2_worker(True)
self.assertEqual(result, {"yue2_worker": "yue2", "state": "running"})
self.assertIn(("POST", "/containers/id-ultra/stop?t=120"), calls)
self.assertIn(("POST", "/containers/id-music/stop?t=30"), calls)
self.assertEqual(calls[-1], ("POST", "/containers/id-yue2/start"))
def test_voice_change_start_exclusively_stops_gpu_workers(self):
profiles = {name: item(name) for name in controller.ALLOWED}
profiles["medium"] = item("medium", "running")