[Voxtral] Follow up to raise BadRequest for ref_audio (#7649)
Signed-off-by: Clodagh Walsh <clodaghwalsh17@gmail.com>
This commit is contained in:
1 parent
f5e4f5fa42
commit
bf74544a35
1 file changed
+4
-3
@@ -99,9 +99,10 @@ class VoxtralTTSAdapter(ARTTSAdapter):
|
|||||||
) -> PreparedRequest:
|
) -> PreparedRequest:
|
||||||
# Cache encoder_loaded property to avoid RPC call on every request with ref_audio
|
# Cache encoder_loaded property to avoid RPC call on every request with ref_audio
|
||||||
if self._encoder_loaded is None:
|
if self._encoder_loaded is None:
|
||||||
loaded = await self.ctx.server.engine_client.collective_rpc("encoder_loaded")
|
result = await self.ctx.server.engine_client.collective_rpc("encoder_loaded")
|
||||||
# Flatten results before checking if encoder loaded property is set
|
self._encoder_loaded = any(
|
||||||
self._encoder_loaded = any(sum(loaded, []))
|
bool(x) for r in result if not isinstance(r, dict) for x in (r if isinstance(r, list) else [r])
|
||||||
|
)
|
||||||
|
|
||||||
prompt = await self._build_prompt_async(request)
|
prompt = await self._build_prompt_async(request)
|
||||||
return PreparedRequest(prompt=prompt, tts_params={}, model_type="voxtral_tts")
|
return PreparedRequest(prompt=prompt, tts_params={}, model_type="voxtral_tts")
|
||||||
|
|||||||
Reference in new issue
Block a user