fix: can not find model bug (#12051)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
parent
7a24c957bd
commit
7da4fb68da
2 changed files with 3 additions and 3 deletions
|
|
@ -872,7 +872,7 @@ class ProviderConfiguration(BaseModel):
|
||||||
# if llm name not in restricted llm list, remove it
|
# if llm name not in restricted llm list, remove it
|
||||||
restrict_model_names = [rm.model for rm in restrict_models]
|
restrict_model_names = [rm.model for rm in restrict_models]
|
||||||
for model in provider_models:
|
for model in provider_models:
|
||||||
if model.model_type == ModelType.LLM and m.model not in restrict_model_names:
|
if model.model_type == ModelType.LLM and model.model not in restrict_model_names:
|
||||||
model.status = ModelStatus.NO_PERMISSION
|
model.status = ModelStatus.NO_PERMISSION
|
||||||
elif not quota_configuration.is_valid:
|
elif not quota_configuration.is_valid:
|
||||||
model.status = ModelStatus.QUOTA_EXCEEDED
|
model.status = ModelStatus.QUOTA_EXCEEDED
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ from configs import dify_config
|
||||||
from core.entities.model_entities import (
|
from core.entities.model_entities import (
|
||||||
ModelWithProviderEntity,
|
ModelWithProviderEntity,
|
||||||
ProviderModelWithStatusEntity,
|
ProviderModelWithStatusEntity,
|
||||||
SimpleModelProviderEntity,
|
|
||||||
)
|
)
|
||||||
from core.entities.provider_entities import QuotaConfiguration
|
from core.entities.provider_entities import QuotaConfiguration
|
||||||
from core.model_runtime.entities.common_entities import I18nObject
|
from core.model_runtime.entities.common_entities import I18nObject
|
||||||
|
|
@ -152,7 +151,8 @@ class ModelWithProviderEntityResponse(ModelWithProviderEntity):
|
||||||
Model with provider entity.
|
Model with provider entity.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
provider: SimpleModelProviderEntity
|
# FIXME type error ignore here
|
||||||
|
provider: SimpleProviderEntityResponse # type: ignore
|
||||||
|
|
||||||
def __init__(self, model: ModelWithProviderEntity) -> None:
|
def __init__(self, model: ModelWithProviderEntity) -> None:
|
||||||
super().__init__(**model.model_dump())
|
super().__init__(**model.model_dump())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue