From 5b5c9221317aea3716df8371a0f447b45bb7d60e Mon Sep 17 00:00:00 2001 From: Binx Date: Wed, 17 Jun 2026 13:26:47 +0800 Subject: [PATCH] fix: Qwen3 TTS Model default voice parameters not support longxiaochun --- .../credential/tts.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/apps/models_provider/impl/aliyun_bai_lian_model_provider/credential/tts.py b/apps/models_provider/impl/aliyun_bai_lian_model_provider/credential/tts.py index f2208a5b0d8..ed6f2f0dce4 100644 --- a/apps/models_provider/impl/aliyun_bai_lian_model_provider/credential/tts.py +++ b/apps/models_provider/impl/aliyun_bai_lian_model_provider/credential/tts.py @@ -57,6 +57,37 @@ class AliyunBaiLianTTSModelGeneralParams(BaseForm): ) +class AliyunBaiLianQwenTTSModelGeneralParams(BaseForm): + """ + Parameters class for the Aliyun BaiLian Qwen TTS model. + Defines fields such as voice and speech rate. + """ + + voice = SingleSelect( + TooltipLabel(_('Timbre'), _('Please select a system voice supported by Qwen-TTS')), + required=True, + default_value='Cherry', + text_field='value', + value_field='value', + option_list=[ + {'label': 'Cherry', 'value': 'Cherry'}, + {'label': 'Serena', 'value': 'Serena'}, + {'label': 'Ethan', 'value': 'Ethan'}, + {'label': 'Chelsie', 'value': 'Chelsie'}, + ] + ) + + speech_rate = SliderField( + TooltipLabel(_('Speaking speed'), _('[0.5, 2], the default is 1, usually one decimal place is enough')), + required=True, + default_value=1, + _min=0.5, + _max=2, + _step=0.1, + precision=1 + ) + + class AliyunBaiLianTTSModelCredential(BaseForm, BaseModelCredential): """ Credential class for the Aliyun BaiLian TTS (Text-to-Speech) model. @@ -140,4 +171,6 @@ def get_model_params_setting_form(self, model_name: str): :param model_name: Name of the model. :return: Parameter setting form. """ + if 'qwen' in model_name and 'tts' in model_name: + return AliyunBaiLianQwenTTSModelGeneralParams() return AliyunBaiLianTTSModelGeneralParams()