From 874340f39688ea690ca1ca9b9dea0d4e85c647a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E5=87=A4=E7=A7=91=E6=8A=80?= Date: Tue, 18 Feb 2025 09:19:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=88=9B=E5=BB=BA=EF=BC=8C=E5=85=B1=E7=94=A8?= =?UTF-8?q?=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/private_config.py | 11 +---------- core/connection.py | 6 ++---- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/config/private_config.py b/config/private_config.py index 9b925e1ee..b1596b8f5 100644 --- a/config/private_config.py +++ b/config/private_config.py @@ -172,21 +172,12 @@ class PrivateConfig: # 判断存在私有配置,并且self.device_id在私有配置中 if not self.private_config: self.logger.bind(tag=TAG).error("Private config not found for device_id: {}", self.device_id) - return None, None, None, None + return None, None """创建私有处理模块实例""" config = self.private_config selected_modules = config['selected_module'] return ( - vad.create_instance( - selected_modules["VAD"], - config["VAD"][selected_modules["VAD"]] - ), - asr.create_instance( - selected_modules["ASR"], - config["ASR"][selected_modules["ASR"]], - self.default_config.get("delete_audio", True) # Using default_config for global settings - ), llm.create_instance( selected_modules["LLM"] if not 'type' in config["LLM"][selected_modules["LLM"]] diff --git a/core/connection.py b/core/connection.py index d2645ba30..83251eebb 100644 --- a/core/connection.py +++ b/core/connection.py @@ -108,10 +108,8 @@ class ConnectionHandler: if self.is_device_verified: await self.private_config.update_last_chat_time() - vad, asr, llm, tts = self.private_config.create_private_instances() - if all([vad, asr, llm, tts]): - self.vad = vad - self.asr = asr + llm, tts = self.private_config.create_private_instances() + if all([llm, tts]): self.llm = llm self.tts = tts self.logger.bind(tag=TAG).info(f"Loaded private config and instances for device {device_id}")