From 95676783f07636d3159baa1587f0597c416b94e5 Mon Sep 17 00:00:00 2001 From: yangruiqing <“yrq991121@gmail.com”> Date: Thu, 27 Nov 2025 22:46:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E6=9B=B4=E6=96=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=8E=E6=B3=A8=E9=87=8A=20=E5=9C=A8m1max?= =?UTF-8?q?=2064G=E4=B8=8A=E6=88=90=E5=8A=9F=E8=BF=90=E8=A1=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=94=B9=E5=8A=A8=E7=9A=84=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉 `connection_ttl` 配置项以避免冲突 - 添加 `LiteAvatar` 模块的完整配置示例并修改 `use_gpu` 默认值为 false - 移除 `pyproject.toml` 中对 torch 相关包的依赖声明 - 修改 `onnxruntime-gpu` 依赖为 `onnxruntime` - 在共享内存缓冲池中安全获取队列大小,防止异常 --- config/chat_with_qwen_omni.yaml | 14 ++++++++++---- pyproject.toml | 2 -- src/handlers/avatar/liteavatar/pyproject.toml | 2 +- .../avatar/liteavatar/shared_memory_buffer_pool.py | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/config/chat_with_qwen_omni.yaml b/config/chat_with_qwen_omni.yaml index 7d8bb1fe..6ae76bda 100644 --- a/config/chat_with_qwen_omni.yaml +++ b/config/chat_with_qwen_omni.yaml @@ -16,7 +16,7 @@ default: module: client/rtc_client/client_handler_rtc connection_ttl: 36000 # max time a session will last for - connection_ttl: 900 + # connection_ttl: 900 SileroVad: module: vad/silerovad/vad_handler_silero speaking_threshold: 0.5 @@ -52,10 +52,16 @@ default: # force_create_avatar: false # Whether to force regenerate digital human data # debug: false # Whether to enable debug mode # multi_thread_inference: true # true: use 2 threads to inference (unet, vae), false: use single-thread to inference + # LiteAvatar: + # module: avatar/liteavatar/avatar_handler_liteavatar + # avatar_name: ~/.cache/modelscope/hub/models/HumanAIGC-Engineering/LiteAvatarGallery/20250408/sample_data/ + # fps: 25 + # debug: false + # enable_fast_mode: false + # use_gpu: false + LiteAvatar: module: avatar/liteavatar/avatar_handler_liteavatar avatar_name: 20250408/sample_data fps: 25 - debug: false - enable_fast_mode: false - use_gpu: true + use_gpu: false \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2001bbb6..ae99507f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,9 +28,7 @@ dependencies = [ "tqdm~=4.67.1", "typing-extensions~=4.12.2", "uvicorn~=0.34.0", - "torch==2.8.0", "torchvision", - "torchaudio", "python-dotenv>=1.1.0", ] diff --git a/src/handlers/avatar/liteavatar/pyproject.toml b/src/handlers/avatar/liteavatar/pyproject.toml index a8645d71..9d5f7e51 100644 --- a/src/handlers/avatar/liteavatar/pyproject.toml +++ b/src/handlers/avatar/liteavatar/pyproject.toml @@ -13,5 +13,5 @@ dependencies = [ "typeguard==2.13.3", "vector-quantize-pytorch~=1.21.7", "vocos~=0.1.0", - "onnxruntime-gpu~=1.20.1", + "onnxruntime~=1.20.1", ] diff --git a/src/handlers/avatar/liteavatar/shared_memory_buffer_pool.py b/src/handlers/avatar/liteavatar/shared_memory_buffer_pool.py index 5cf40978..7a6fd06c 100644 --- a/src/handlers/avatar/liteavatar/shared_memory_buffer_pool.py +++ b/src/handlers/avatar/liteavatar/shared_memory_buffer_pool.py @@ -160,7 +160,8 @@ def _attach_audio_pool(self, shm_names: List[str]): except Exception as e: logger.error(f"Failed to attach to audio buffer {i} ({shm_name}): {e}") self.audio_buffers.append(None) - logger.info(f"Audio attached: {len(self.audio_buffers)} buffers, queue: {self.audio_available.qsize()}") + qsize = self._safe_qsize(self.audio_available) + logger.info(f"Audio attached: {len(self.audio_buffers)} buffers, queue: {qsize}") def _attach_video_pool(self, shm_names: List[str]): """Attach to existing video buffer pool.""" @@ -428,4 +429,3 @@ def __del__(self): self.cleanup() except Exception as e: logger.error(f"Error in __del__: {e}") -