Skip to content

Commit a071d7c

Browse files
committed
fix: Alibaba Cloud full modal docking error
--bug=1052232 --user=王孝刚 【模型设置】-大语言模型/语音识别模型 对接不上阿里云的全模态模型 https://www.tapd.cn/57709429/s/1655034
1 parent b917b72 commit a071d7c

File tree

2 files changed

+4
-1
lines changed
  • apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model

2 files changed

+4
-1
lines changed

apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/llm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from setting.models_provider.base_model_provider import MaxKBBaseModel
66
from setting.models_provider.impl.base_chat_open_ai import BaseChatOpenAI
77

8-
98
class BaiLianChatModel(MaxKBBaseModel, BaseChatOpenAI):
109
@staticmethod
1110
def is_cache_model():
@@ -14,6 +13,8 @@ def is_cache_model():
1413
@staticmethod
1514
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
1615
optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs)
16+
if model_name == 'qwen-omni-turbo':
17+
optional_params['streaming'] = True
1718
return BaiLianChatModel(
1819
model=model_name,
1920
openai_api_base=model_credential.get('api_base'),

apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/stt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def new_instance(model_type, model_name, model_credential: Dict[str, object], **
2626
optional_params['max_tokens'] = model_kwargs['max_tokens']
2727
if 'temperature' in model_kwargs and model_kwargs['temperature'] is not None:
2828
optional_params['temperature'] = model_kwargs['temperature']
29+
if model_name == 'qwen-omni-turbo':
30+
optional_params['streaming'] = True
2931
return AliyunBaiLianSpeechToText(
3032
model=model_name,
3133
api_key=model_credential.get('api_key'),

0 commit comments

Comments
 (0)