Skip to content

Commit c1ec147

Browse files
Binx98liuruibin
authored andcommitted
fix: Qwen3 TTS Model default voice parameters not support longxiaochun
1 parent a4c526e commit c1ec147

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

  • apps/models_provider/impl/aliyun_bai_lian_model_provider/credential

apps/models_provider/impl/aliyun_bai_lian_model_provider/credential/tts.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,37 @@ class AliyunBaiLianTTSModelGeneralParams(BaseForm):
5757
)
5858

5959

60+
class AliyunBaiLianQwenTTSModelGeneralParams(BaseForm):
61+
"""
62+
Parameters class for the Aliyun BaiLian Qwen TTS model.
63+
Defines fields such as voice and speech rate.
64+
"""
65+
66+
voice = SingleSelect(
67+
TooltipLabel(_('Timbre'), _('Please select a system voice supported by Qwen-TTS')),
68+
required=True,
69+
default_value='Cherry',
70+
text_field='value',
71+
value_field='value',
72+
option_list=[
73+
{'label': 'Cherry', 'value': 'Cherry'},
74+
{'label': 'Serena', 'value': 'Serena'},
75+
{'label': 'Ethan', 'value': 'Ethan'},
76+
{'label': 'Chelsie', 'value': 'Chelsie'},
77+
]
78+
)
79+
80+
speech_rate = SliderField(
81+
TooltipLabel(_('Speaking speed'), _('[0.5, 2], the default is 1, usually one decimal place is enough')),
82+
required=True,
83+
default_value=1,
84+
_min=0.5,
85+
_max=2,
86+
_step=0.1,
87+
precision=1
88+
)
89+
90+
6091
class AliyunBaiLianTTSModelCredential(BaseForm, BaseModelCredential):
6192
"""
6293
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):
140171
:param model_name: Name of the model.
141172
:return: Parameter setting form.
142173
"""
174+
if 'qwen' in model_name and 'tts' in model_name:
175+
return AliyunBaiLianQwenTTSModelGeneralParams()
143176
return AliyunBaiLianTTSModelGeneralParams()

0 commit comments

Comments
 (0)