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
+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")