mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-21 00:36:53 +08:00
fix: azure customize model name duplicate (#2073)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import copy
|
||||||
import logging
|
import logging
|
||||||
from typing import Generator, List, Optional, Union, cast
|
from typing import Generator, List, Optional, Union, cast
|
||||||
|
|
||||||
@@ -625,9 +626,10 @@ class AzureOpenAILargeLanguageModel(_CommonAzureOpenAI, LargeLanguageModel):
|
|||||||
def _get_ai_model_entity(base_model_name: str, model: str) -> AzureBaseModel:
|
def _get_ai_model_entity(base_model_name: str, model: str) -> AzureBaseModel:
|
||||||
for ai_model_entity in LLM_BASE_MODELS:
|
for ai_model_entity in LLM_BASE_MODELS:
|
||||||
if ai_model_entity.base_model_name == base_model_name:
|
if ai_model_entity.base_model_name == base_model_name:
|
||||||
ai_model_entity.entity.model = model
|
ai_model_entity_copy = copy.deepcopy(ai_model_entity)
|
||||||
ai_model_entity.entity.label.en_US = model
|
ai_model_entity_copy.entity.model = model
|
||||||
ai_model_entity.entity.label.zh_Hans = model
|
ai_model_entity_copy.entity.label.en_US = model
|
||||||
return ai_model_entity
|
ai_model_entity_copy.entity.label.zh_Hans = model
|
||||||
|
return ai_model_entity_copy
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import base64
|
import base64
|
||||||
|
import copy
|
||||||
import time
|
import time
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
@@ -186,9 +187,10 @@ class AzureOpenAITextEmbeddingModel(_CommonAzureOpenAI, TextEmbeddingModel):
|
|||||||
def _get_ai_model_entity(base_model_name: str, model: str) -> AzureBaseModel:
|
def _get_ai_model_entity(base_model_name: str, model: str) -> AzureBaseModel:
|
||||||
for ai_model_entity in EMBEDDING_BASE_MODELS:
|
for ai_model_entity in EMBEDDING_BASE_MODELS:
|
||||||
if ai_model_entity.base_model_name == base_model_name:
|
if ai_model_entity.base_model_name == base_model_name:
|
||||||
ai_model_entity.entity.model = model
|
ai_model_entity_copy = copy.deepcopy(ai_model_entity)
|
||||||
ai_model_entity.entity.label.en_US = model
|
ai_model_entity_copy.entity.model = model
|
||||||
ai_model_entity.entity.label.zh_Hans = model
|
ai_model_entity_copy.entity.label.en_US = model
|
||||||
return ai_model_entity
|
ai_model_entity_copy.entity.label.zh_Hans = model
|
||||||
|
return ai_model_entity_copy
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user