From e122d677ada816bf3986e34dbecdc1fc515afce5 Mon Sep 17 00:00:00 2001 From: takatost Date: Sun, 22 Oct 2023 03:02:38 +0800 Subject: [PATCH] fix: return wrong when init 0 quota in trial provider (#1394) --- api/core/model_providers/model_provider_factory.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/core/model_providers/model_provider_factory.py b/api/core/model_providers/model_provider_factory.py index 77f77573475a1c..985dc274b37762 100644 --- a/api/core/model_providers/model_provider_factory.py +++ b/api/core/model_providers/model_provider_factory.py @@ -211,6 +211,9 @@ def _get_preferred_provider(cls, tenant_id: str, model_provider_name: str): Provider.quota_type == ProviderQuotaType.TRIAL.value ).first() + if provider.quota_limit == 0: + return None + return provider no_system_provider = True