Add isolated Qwen3 TTS runtime, GUI setup and speech endpoint
This commit is contained in:
@@ -55,6 +55,15 @@ class EndpointTests(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):self.enable('audio')
|
||||
self.assertEqual(self.request('/v1/audio/speech',{})[0],501)
|
||||
self.record['api_token_hash']=hashlib.sha256(b'B'*32).hexdigest();self.assertEqual(self.request()[0],401);self.assertEqual(self.request(token='B'*32)[0],200)
|
||||
def test_tts_endpoint_returns_wav_and_requires_publication(self):
|
||||
self.rows[-1].update(runnable=True,blockers=[])
|
||||
self.ep.tts=Mock();self.ep.tts.start.return_value={'id':'a'*32};self.ep.tts.status.return_value={'job':{'id':'a'*32,'state':'complete'}};self.ep.tts.audio.return_value=b'RIFF-test-WAVE'
|
||||
self.assertEqual(self.request('/v1/audio/speech',{'model':'audio','input':'hello'})[0],404)
|
||||
self.enable('audio')
|
||||
self.assertEqual(self.request('/v1/audio/speech',{'model':'audio','input':'hello','response_format':'mp3'})[0],400)
|
||||
c=http.client.HTTPConnection('127.0.0.1',self.port,timeout=5);c.request('POST','/v1/audio/speech',json.dumps({'model':'audio','input':'hello','voice':'Ryan','response_format':'wav'}),{'Content-Type':'application/json','Authorization':'Bearer '+'A'*32});r=c.getresponse()
|
||||
self.assertEqual(r.status,200);self.assertEqual(r.getheader('Content-Type'),'audio/wav');self.assertEqual(r.read(),b'RIFF-test-WAVE');c.close()
|
||||
self.assertEqual(self.ep.tts.start.call_args.kwargs['speaker'],'Ryan')
|
||||
def test_single_image_selection_preserves_multiple_llms(self):
|
||||
self.rows.append(dict(self.rows[2],id='image2',name='image2'))
|
||||
self.enable('alpha');self.enable('beta');self.enable('image');self.enable('image2')
|
||||
|
||||
Reference in New Issue
Block a user