mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: handle audio generation failure by raising an exception
This commit is contained in:
parent
2971406909
commit
1e8e3a90aa
|
|
@ -46,6 +46,8 @@ class AliyunBaiLianTextToSpeech(MaxKBBaseModel, BaseTextToSpeech):
|
|||
from dashscope.audio.tts_v2 import SpeechSynthesizer
|
||||
synthesizer = SpeechSynthesizer(model=self.model, **self.params)
|
||||
audio = synthesizer.call(text)
|
||||
if audio is None:
|
||||
raise Exception('Failed to generate audio')
|
||||
if type(audio) == str:
|
||||
print(audio)
|
||||
raise Exception(audio)
|
||||
|
|
|
|||
Loading…
Reference in New Issue