From 5413c41a012b67a5e828a30e03cebe029e27e930 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer Date: Wed, 30 Jul 2025 18:31:41 +0800 Subject: [PATCH] =?UTF-8?q?template=E6=9B=B4=E6=96=B0=EF=BC=8C=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/config.py | 6 ++++++ template/model_config_template.toml | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/config/config.py b/src/config/config.py index 645a9f179..868739436 100644 --- a/src/config/config.py +++ b/src/config/config.py @@ -376,6 +376,12 @@ class APIAdapterConfig(ConfigBase): self.api_providers_dict = {provider.name: provider for provider in self.api_providers} self.models_dict = {model.name: model for model in self.models} + + for model in self.models: + if not model.model_identifier: + raise ValueError(f"模型 '{model.name}' 的 model_identifier 不能为空") + if not model.api_provider or model.api_provider not in self.api_providers_dict: + raise ValueError(f"模型 '{model.name}' 的 api_provider '{model.api_provider}' 不存在") def get_model_info(self, model_name: str) -> ModelInfo: """根据模型名称获取模型信息""" diff --git a/template/model_config_template.toml b/template/model_config_template.toml index 62a2b3a44..e99f039d3 100644 --- a/template/model_config_template.toml +++ b/template/model_config_template.toml @@ -46,13 +46,6 @@ api_provider = "SiliconFlow" price_in = 2.0 price_out = 8.0 -[[models]] -model_identifier = "Pro/deepseek-ai/DeepSeek-R1" -name = "siliconflow-deepseek-r1" -api_provider = "SiliconFlow" -price_in = 4.0 -price_out = 16.0 - [[models]] model_identifier = "Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B" name = "deepseek-r1-distill-qwen-32b"