Skip to content

Commit eceb8f8

Browse files
committed
refactor: simplify optional parameters and update image generation base URL
1 parent a5cd50f commit eceb8f8

File tree

1 file changed

+2
-5
lines changed
  • apps/models_provider/impl/aliyun_bai_lian_model_provider/model

1 file changed

+2
-5
lines changed

apps/models_provider/impl/aliyun_bai_lian_model_provider/model/tti.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def is_cache_model():
3030

3131
@staticmethod
3232
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
33-
optional_params = {'params': {'size': '1024*1024', 'style': '<auto>', 'n': 1}}
33+
optional_params = {'params': {'size': '1024*1024', 'n': 1}}
3434
for key, value in model_kwargs.items():
3535
if key not in ['model_id', 'use_local', 'streaming']:
3636
optional_params['params'][key] = value
@@ -41,17 +41,14 @@ def new_instance(model_type, model_name, model_credential: Dict[str, object], **
4141
)
4242
return chat_tong_yi
4343

44-
def is_cache_model(self):
45-
return False
46-
4744
def check_auth(self):
4845
chat = ChatTongyi(api_key=self.api_key, model_name='qwen-max')
4946
chat.invoke([HumanMessage([{"type": "text", "text": gettext('Hello')}])])
5047

5148
def generate_image(self, prompt: str, negative_prompt: str = None):
52-
# api_base='https://dashscope.aliyuncs.com/compatible-mode/v1',
5349
rsp = ImageSynthesis.call(api_key=self.api_key,
5450
model=self.model_name,
51+
base_url='https://dashscope.aliyuncs.com/compatible-mode/v1',
5552
prompt=prompt,
5653
negative_prompt=negative_prompt,
5754
**self.params)

0 commit comments

Comments
 (0)