xiaozhi-esp32-server/main/xiaozhi-server/tests
Allen 5079949d9d fix(asr): 本地 ASR 实例进程内复用,避免每连接 3GB(#3365)
FunASR 属于 InterfaceType.LOCAL,但只有"默认语音模型恰好也是 FunASR"时才会
命中服务端的共享实例;智控台里默认模型选别的、智能体选 FunASR 时,每个 WS
连接都会各自 AutoModel 加载一份(约 3GB),设备快速连断几次就把机器内存吃满。
现在按「类型 + 配置」在 core/utils/asr.py 做进程内缓存(首次加载持锁,避免并发
重复加载),并对共享实例的 generate 加锁串行化推理。

两处相对原补丁的修正:
- vosk 不进缓存名单:它的 KaldiRecognizer 建在实例上、跨调用累积波形状态且非
  线程安全,多连接共用一个 recognizer 会互相串音;vosk 模型只有几十 MB,
  复用收益有限。
- 缓存 key 纳入 delete_audio_file 等其余构造参数,原来的 key 只用 config,
  构造参数不同的两次创建会错误复用同一个实例。

主体改动来自上游仓库对象库中已存在的 commit fefa392a(作者 agent <agent@local>,
2026-11-23),挂在 #3365 的 referenced 事件上,但既没有分支也没有 PR。
2026-11-26 15:11:50 +08:00
..
config revert(config): 移除 mem_report_only 出厂配置块,维持单模块 fail-fast 契约 2026-11-13 17:42:16 +08:00
core fix(asr): 本地 ASR 实例进程内复用,避免每连接 3GB(#3365) 2026-11-26 15:11:50 +08:00
plugins_func Merge pull request #3548 from zhenglieAllen/zhenglieAllen/fix/check-model-key-none 2026-11-19 09:52:20 +08:00
__init__.py 加 Python 冒烟测试,验证 pytest 流水线 2026-09-02 22:24:35 +08:00
conftest.py Merge branch 'main' into py-test-ollama 2026-11-19 11:13:30 +08:00
test_llm.py Merge branch 'main' into py-test-ollama 2026-11-19 11:13:30 +08:00
test_manage_api_client_lifecycle.py 迁移测试用例,优化相关注释 2026-10-13 14:31:21 +08:00
test_memory.py chore(deps): 批量升级 4 个允许的依赖 (#3374) 2026-09-17 15:57:43 +08:00
test_rag.py chore(deps): 批量升级 4 个允许的依赖 (#3374) 2026-09-17 15:57:43 +08:00
test_smoke.py 加 Python 冒烟测试,验证 pytest 流水线 2026-09-02 22:24:35 +08:00
test_stt.py chore(deps): 批量升级 4 个允许的依赖 (#3374) 2026-09-17 15:57:43 +08:00
test_tts.py 调整相关测试 2026-11-19 17:11:57 +08:00