remove bare list, dict, Sequence, None, Any (#25058)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Asuka Minato
2025-09-06 04:32:23 +09:00
committed by GitHub
parent 2b0695bdde
commit a78339a040
306 changed files with 787 additions and 817 deletions

View File

@@ -32,7 +32,7 @@ class ModelInstance:
Model instance class
"""
def __init__(self, provider_model_bundle: ProviderModelBundle, model: str) -> None:
def __init__(self, provider_model_bundle: ProviderModelBundle, model: str):
self.provider_model_bundle = provider_model_bundle
self.model = model
self.provider = provider_model_bundle.configuration.provider.provider
@@ -46,7 +46,7 @@ class ModelInstance:
)
@staticmethod
def _fetch_credentials_from_bundle(provider_model_bundle: ProviderModelBundle, model: str) -> dict:
def _fetch_credentials_from_bundle(provider_model_bundle: ProviderModelBundle, model: str):
"""
Fetch credentials from provider model bundle
:param provider_model_bundle: provider model bundle
@@ -342,7 +342,7 @@ class ModelInstance:
),
)
def _round_robin_invoke(self, function: Callable[..., Any], *args, **kwargs) -> Any:
def _round_robin_invoke(self, function: Callable[..., Any], *args, **kwargs):
"""
Round-robin invoke
:param function: function to invoke
@@ -379,7 +379,7 @@ class ModelInstance:
except Exception as e:
raise e
def get_tts_voices(self, language: Optional[str] = None) -> list:
def get_tts_voices(self, language: Optional[str] = None):
"""
Invoke large language tts model voices
@@ -394,7 +394,7 @@ class ModelInstance:
class ModelManager:
def __init__(self) -> None:
def __init__(self):
self._provider_manager = ProviderManager()
def get_model_instance(self, tenant_id: str, provider: str, model_type: ModelType, model: str) -> ModelInstance:
@@ -453,7 +453,7 @@ class LBModelManager:
model: str,
load_balancing_configs: list[ModelLoadBalancingConfiguration],
managed_credentials: Optional[dict] = None,
) -> None:
):
"""
Load balancing model manager
:param tenant_id: tenant_id
@@ -534,7 +534,7 @@ model: %s""",
return config
def cooldown(self, config: ModelLoadBalancingConfiguration, expire: int = 60) -> None:
def cooldown(self, config: ModelLoadBalancingConfiguration, expire: int = 60):
"""
Cooldown model load balancing config
:param config: model load balancing config