mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Alibaba Cloud full modal docking error
--bug=1052232 --user=王孝刚 【模型设置】-大语言模型/语音识别模型 对接不上阿里云的全模态模型 https://www.tapd.cn/57709429/s/1655034
This commit is contained in:
parent
b917b72fe6
commit
a071d7c89b
|
|
@ -5,7 +5,6 @@ from typing import Dict
|
|||
from setting.models_provider.base_model_provider import MaxKBBaseModel
|
||||
from setting.models_provider.impl.base_chat_open_ai import BaseChatOpenAI
|
||||
|
||||
|
||||
class BaiLianChatModel(MaxKBBaseModel, BaseChatOpenAI):
|
||||
@staticmethod
|
||||
def is_cache_model():
|
||||
|
|
@ -14,6 +13,8 @@ class BaiLianChatModel(MaxKBBaseModel, BaseChatOpenAI):
|
|||
@staticmethod
|
||||
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
|
||||
optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs)
|
||||
if model_name == 'qwen-omni-turbo':
|
||||
optional_params['streaming'] = True
|
||||
return BaiLianChatModel(
|
||||
model=model_name,
|
||||
openai_api_base=model_credential.get('api_base'),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class AliyunBaiLianSpeechToText(MaxKBBaseModel, BaseSpeechToText):
|
|||
optional_params['max_tokens'] = model_kwargs['max_tokens']
|
||||
if 'temperature' in model_kwargs and model_kwargs['temperature'] is not None:
|
||||
optional_params['temperature'] = model_kwargs['temperature']
|
||||
if model_name == 'qwen-omni-turbo':
|
||||
optional_params['streaming'] = True
|
||||
return AliyunBaiLianSpeechToText(
|
||||
model=model_name,
|
||||
api_key=model_credential.get('api_key'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue