feat(windows): add sherpa-onnx local ASR#504
Open
weikeyi wants to merge 2 commits into
Open
Conversation
PR Reviewer Guide 🔍(Review updated until commit 7072c30)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit 691068f |
691068f to
55c4531
Compare
|
Persistent review updated to latest commit 55c4531 |
Collaborator
|
那啥,你搞完了踢我一下 |
55c4531 to
7072c30
Compare
|
Persistent review updated to latest commit 7072c30 |
Contributor
Author
|
@H-Chris233 冲突解决完了 |
Collaborator
|
对于 release-archive 模型,此函数只检查归档文件本身。下载成功后,归档会被解压并删除,因此尽管模型文件已经存在,downloaded_bytes 仍会回落为 0。这会导致 UI 和任何状态逻辑将已完整下载的模型报告为缓存为空。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
背景
本 PR 为 Windows 端接入
sherpa-onnx本地离线 ASR 能力,补齐 OpenLess 在 Windows 上不依赖云端服务的语音识别路径。目标是让用户可以在本地下载、管理 Sherpa 模型,并通过现有 Tauri/React 设置页启用本地识别,同时保持现有 Qwen、Foundry、云端 ASR 路径不受影响。
主要变更
1. 新增 Windows Sherpa 本地 ASR 后端
sense-voice-small-zhparaformer-zhwhisper-small-multisherpa-onnx = 1.13.2静态链接依赖。2. 新增 Sherpa 模型下载与管理
sherpa-onnx-asr-download-progress3. 扩展 Tauri IPC 命令
新增 Sherpa 相关命令,用于前端管理本地模型和运行时状态,包括:
同时在 lib.rs 中注册
SherpaDownloadManager和相关 command handler。4. 接入 coordinator 运行链路
sherpa-onnx-localprovider。5. 前端 Local ASR / Settings 页面集成
6. Windows Common Controls v6 manifest 修复
Sherpa 测试二进制在 Windows 上曾因为缺少 Common Controls v6 manifest,启动时报
STATUS_ENTRYPOINT_NOT_FOUND。本 PR 在 build.rs 中加入更稳妥的 manifest dependency 注入方式:
/MANIFESTINPUT,避免和 Tauri app 自带 manifest 产生duplicate resource type:MANIFEST。cargo:rustc-link-arg=/MANIFESTDEPENDENCY:...传参,避免 MSVC/Cargo 因空格拆参导致LNK1181。#pragma comment(linker, "/manifestdependency:...")注入 Common Controls v6 dependency,并用/INCLUDE强制 linker 拉入该 object。这样测试二进制和主应用二进制都能获得 Common Controls v6 dependency,同时不会造成 manifest 重复资源冲突。
7. 测试修正
cmdmodifier 归一化为Ctrl的快捷键测试断言。验证结果
已在 Windows 本地完成以下验证:
git diff --check✅git diff --cached --check✅cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml✅cargo build --manifest-path openless-all/app/src-tauri/Cargo.toml✅cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml sherpa --lib -- --nocapture✅19 passedcargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib✅323 passednpm run build✅已知非阻塞项
PR Type
Enhancement, Tests
Description
Add sherpa-onnx Windows ASR runtime
Add model download and verification
Wire coordinator, commands, preferences
Update UI, i18n, and tests
Diagram Walkthrough
File Walkthrough
18 files
Add sherpa local ASR commands and guardsImplement Sherpa model download managementAdd Sherpa runtime skeleton and lifecycleDefine Sherpa catalog and event payloadsIntegrate Sherpa runtime into coordinatorRoute dictation flow to Sherpa providerRegister Sherpa services and commandsExport Sherpa local ASR modulesUpdate hotkey handling for settings syncExtend coordinator resource wiringAlign QA hotkey handling with settingsAdd local ASR Sherpa UI surfaceAdd Sherpa IPC command bindingsExtend local ASR client helpersSurface Sherpa settings in advanced panelRefresh hotkey settings context wiringShare updated local ASR settings UIAdd Sherpa client-side type definitions3 files
Persist Sherpa model and runtime settingsAdd Windows manifest dependency build stepPersist new Sherpa preferences fields2 files
Expose download helpers and partial sizesFix runtime detection string assertions6 files
Document Sherpa ASR rollout planAdd Japanese Sherpa local ASR copyAdd Korean Sherpa local ASR copyAdd Traditional Chinese Sherpa copyAdd Simplified Chinese Sherpa copyAdd English Sherpa local ASR copy2 files
Add backend test coverage for Sherpa stubsExpand style preference test coverage1 files
Add Windows sherpa-onnx dependency1 files