Add OpenWebUI audio separation with individual WAV results
This commit is contained in:
1 parent
b99abaea25
commit
24706f450e
8 files changed
+441
-10
No files matched your search
@@ -61,6 +61,31 @@ class Tests(unittest.TestCase):
|
||||
worker=SeparatorTests(root,Mock(),scheduler)
|
||||
with self.assertRaisesRegex(ValueError,'Steuerung'):worker.start(next(iter(MODELS)),audio(),full=True)
|
||||
|
||||
def test_chat_job_accepts_llm_mode_and_waits_without_interrupting_a_request(self):
|
||||
from inference import Scheduler,InferenceError
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
scheduler=Scheduler(Mock());runtime=Mock();runtime.status.return_value={'installed':True}
|
||||
worker=SeparatorTests(root,runtime,scheduler)
|
||||
with patch('separator.threading.Thread'):
|
||||
self.assertEqual(worker.start('model_bs_roformer_ep_317_sdr_12.9755.ckpt',audio(),target='vocals',full=True,automatic=True)['state'],'running')
|
||||
scheduler.gpu_mode='music';worker.job=None
|
||||
with self.assertRaisesRegex(ValueError,'Betriebsart'):worker.start(next(iter(MODELS)),audio(),full=True,automatic=True)
|
||||
scheduler.gpu_mode='llm'
|
||||
with scheduler.lease('chat'):
|
||||
stop_count=scheduler.worker.stop.call_count
|
||||
with self.assertRaises(InferenceError):scheduler.image_reservation(kind='separator')
|
||||
self.assertEqual(scheduler.worker.stop.call_count,stop_count)
|
||||
with self.assertRaises(InferenceError):scheduler.image_reservation(kind='separator',allowed=lambda:False)
|
||||
self.assertEqual(scheduler.status()['active_requests'],0)
|
||||
|
||||
def test_cancelled_chat_job_does_not_load_the_separator(self):
|
||||
from inference import Scheduler
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
worker=SeparatorTests(root,Mock(),Scheduler(Mock()));worker.automatic=True
|
||||
worker.job={'id':'a'*32,'state':'running','started_at':0};worker.cancel.set()
|
||||
with patch('separator.subprocess.Popen') as process:worker._run(next(iter(MODELS)),audio())
|
||||
process.assert_not_called();self.assertEqual(worker.scheduler.status()['active_requests'],0)
|
||||
|
||||
def test_profiles_prefer_5080_and_fixed_device_never_falls_back(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
worker=SeparatorTests(Path(root)/'separator-tests',Mock(),Mock());model=next(iter(MODELS))
|
||||
|
||||
Reference in new issue
Block a user