mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: model params
This commit is contained in:
parent
cabd6fb7f5
commit
6f6e823117
|
|
@ -52,7 +52,7 @@ class QwenVLModelCredential(BaseForm, BaseModelCredential):
|
|||
return False
|
||||
try:
|
||||
model = provider.get_model(model_type, model_name, model_credential, **model_params)
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": _('Hello')}])])
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": gettext('Hello')}])])
|
||||
for chunk in res:
|
||||
print(chunk)
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class QwenTextToImageModel(MaxKBBaseModel, BaseTextToImage):
|
|||
|
||||
def check_auth(self):
|
||||
chat = ChatTongyi(api_key=self.api_key, model_name='qwen-max')
|
||||
chat.invoke([HumanMessage([{"type": "text", "text": _('Hello')}])])
|
||||
chat.invoke([HumanMessage([{"type": "text", "text": gettext('Hello')}])])
|
||||
|
||||
def generate_image(self, prompt: str, negative_prompt: str = None):
|
||||
# api_base='https://dashscope.aliyuncs.com/compatible-mode/v1',
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class AzureOpenAIImageModelCredential(BaseForm, BaseModelCredential):
|
|||
return False
|
||||
try:
|
||||
model = provider.get_model(model_type, model_name, model_credential, **model_params)
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": _('Hello')}])])
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": gettext('Hello')}])])
|
||||
for chunk in res:
|
||||
print(chunk)
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class OpenAIImageModelCredential(BaseForm, BaseModelCredential):
|
|||
return False
|
||||
try:
|
||||
model = provider.get_model(model_type, model_name, model_credential, **model_params)
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": _('Hello')}])])
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": gettext('Hello')}])])
|
||||
for chunk in res:
|
||||
print(chunk)
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class QwenTextToImageModel(MaxKBBaseModel, BaseTextToImage):
|
|||
|
||||
def check_auth(self):
|
||||
chat = ChatTongyi(api_key=self.api_key, model_name='qwen-max')
|
||||
chat.invoke([HumanMessage([{"type": "text", "text": _('Hello')}])])
|
||||
chat.invoke([HumanMessage([{"type": "text", "text": gettext('Hello')}])])
|
||||
|
||||
def generate_image(self, prompt: str, negative_prompt: str = None):
|
||||
# api_base='https://dashscope.aliyuncs.com/compatible-mode/v1',
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class ZhiPuTextToImage(MaxKBBaseModel, BaseTextToImage):
|
|||
zhipuai_api_key=self.api_key,
|
||||
model_name=self.model,
|
||||
)
|
||||
chat.invoke([HumanMessage([{"type": "text", "text": _('Hello')}])])
|
||||
chat.invoke([HumanMessage([{"type": "text", "text": gettext('Hello')}])])
|
||||
|
||||
# self.generate_image('生成一个小猫图片')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue