本地模型增加whisper相关模型的支持; 增加qwen3-asr的rust版本, 相比C版本速度更快 (#940)

* feat: add selectable local ASR backends

* fix(build): 修复本地 ASR 多平台构建与旧渠道兼容

* fix(asr): 修复 MLX 权重跨线程 stream 错误

* fix(ci): exclude MLX Qwen3 from non-macOS jobs

* fix(ci): use app-relative ASR submodule path

* fix(android): skip qwen-asr C backend

* fix(android): guard qwen-asr by target triple

* fix(ci): 修正语法错误

* fix(ci): remove invalid checkout step options

* fix(asr): harden local backend integration

* fix(asr): 处理 PR #940 审查发现(9 项)

- strip: 全局保留 symbols,macOS release profile 单独退回 debuginfo(Homebrew rustc 的 LINKEDIT 问题仅限 macOS)
- 转录超时改为驱逐引擎而非无效 cancel():spawn_blocking 解码任务无法被中止,驱逐后下次会话加载新引擎而非排队
- Turbo/Q5 共享目录模型在 is_downloaded/downloaded_bytes/delete_model 上互相认账
- MLX 临时 WAV 用 RAII guard 兜底清理;HF tree API 改 Link rel=next 游标分页(offset 被服务器静默忽略),带防御上限与 5 个单测
- Intel Mac 渠道下拉不再闪现 MLX 预设;MetalToolchainGuide 默认折叠并标注仅源码构建期要求
- qwen3-asr-rs 子模块 URL 与 gitlink 指向 Open-Less org 镜像,嵌套 mlx-c 同步改指 org(供应链 N-6)
- README/注释补充:所有平台源码构建均需递归初始化子模块(path 依赖跨 target 解析)

* fix: harden local whisper model lifecycle and downloads

* fix(asr): address PR 940 review findings

* fix(ci): add local ASR model stub to backend tests

* fix(linux): bundle and sync fcitx5 selection plugin

* fix(macos): avoid duplicate whisper test module

* fix(history): make detail sibling keys unique

* fix(ci): stub macos whisper model constant

* test(ci): avoid macOS streaming timeout race

---------

Co-authored-by: Chris233 <h-chris233@outlook.com>
This commit is contained in:
Jimmy LeeandChris233 authored and GitHub committed 2026-08-20 20:22:02 +08:00
1 parent fac8ddc685
commit 42c1b31754
60 files changed
+4005 -479

No files matched your search

+3 -1
View File
@@ -256,10 +256,12 @@ For the full end-user walkthrough, see [USAGE.md](USAGE.md).
## Build from source (developers)
The active codebase lives in `openless-all/app/` (Tauri 2 + Rust + React/TS). The macOS build links a vendored C ASR engine ([`Open-Less/qwen-asr`](https://github.com/Open-Less/qwen-asr), forked from `antirez/qwen-asr`) pulled in as a git submodule under `src-tauri/vendor/qwen-asr/`, so initialize submodules on first clone.
The active codebase lives in `openless-all/app/` (Tauri 2 + Rust + React/TS). The macOS build links a vendored C ASR engine ([`Open-Less/qwen-asr`](https://github.com/Open-Less/qwen-asr), forked from `antirez/qwen-asr`) pulled in as a git submodule under `src-tauri/vendor/qwen-asr/`, so initialize submodules on first clone. **Recursive submodule initialization is required on every platform** — the macOS-only `qwen3-asr-rs` path dependency is still parsed by Cargo on Windows/Linux (skipping it fails `cargo check` at resolution time), and Linux builds compile the vendored C engine too.
Rust 1.88 is the minimum supported toolchain for source builds; the latest stable Rust is recommended. CI verifies both Rust 1.88 and stable on macOS, Windows, and Linux.
On Apple Silicon, compiling the optional Qwen3-ASR MLX backend requires Xcode's MetalToolchain component. Install it with `xcodebuild -downloadComponent MetalToolchain` and verify it with `xcrun --find metal`. This is a source-build dependency; packaged OpenLess applications do not require it at runtime.
```bash
# First clone only — pull in vendored submodules
git submodule update --init --recursive