Add private Vevo2 voice studio mode
This commit is contained in:
@@ -46,7 +46,43 @@ def separator_item(state="exited"):
|
||||
"Labels": {controller.SEPARATOR_LABEL_KEY: "bs-roformer"}}
|
||||
|
||||
|
||||
def voice_item(state="exited"):
|
||||
return {"Id": "id-voice", "State": state,
|
||||
"Labels": {controller.VOICE_LABEL_KEY: "vevo2"}}
|
||||
|
||||
|
||||
class ProfileControllerTests(unittest.TestCase):
|
||||
def test_voice_start_exclusively_stops_gpu_workers(self):
|
||||
profiles = {name: item(name) for name in controller.ALLOWED}
|
||||
profiles["medium"] = item("medium", "running")
|
||||
calls = []
|
||||
|
||||
def request(method, path):
|
||||
calls.append((method, path))
|
||||
return 204, b""
|
||||
|
||||
with patch.object(controller, "VOICE_WORKER", "vevo2"), \
|
||||
patch.object(controller, "MUSIC_WORKER", "acestep"), \
|
||||
patch.object(controller, "SEPARATOR_WORKER", "bs-roformer"), \
|
||||
patch.object(controller, "containers", return_value=profiles), \
|
||||
patch.object(controller, "voice_container", return_value=voice_item()), \
|
||||
patch.object(controller, "music_container", return_value=music_item("running")), \
|
||||
patch.object(controller, "separator_container", return_value=separator_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_voice_worker(True)
|
||||
|
||||
self.assertEqual(result, {"voice_worker": "vevo2", "state": "running"})
|
||||
self.assertEqual(calls, [
|
||||
("POST", "/containers/id-medium/stop?t=120"),
|
||||
("POST", "/containers/id-flux/stop?t=20"),
|
||||
("POST", "/containers/id-tts/stop?t=30"),
|
||||
("POST", "/containers/id-music/stop?t=30"),
|
||||
("POST", "/containers/id-separator/stop?t=30"),
|
||||
("POST", "/containers/id-voice/start"),
|
||||
])
|
||||
|
||||
def test_separator_start_exclusively_stops_gpu_workers(self):
|
||||
profiles = {name: item(name) for name in controller.ALLOWED}
|
||||
profiles["large"] = item("large", "running")
|
||||
|
||||
Reference in New Issue
Block a user