Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3bfd61c
feat(windows): add sherpa-onnx local ASR
weikeyi May 20, 2026
7072c30
test(windows): include sherpa stub in backend test crate
weikeyi May 20, 2026
c7011f7
fix(windows): report extracted sherpa archive size
weikeyi May 21, 2026
83221df
Merge remote-tracking branch 'upstream/beta' into feat/windows-sherpa…
weikeyi May 21, 2026
2fcf45b
Merge pull request #504 from weikeyi/feat/windows-sherpa-onnx-local-asr
H-Chris233 May 22, 2026
52c49fc
feat(settings): 设置界面重构 — 分节化 / 精简 / Beta 渠道 / 麦克风 / 市场登录
May 22, 2026
7dc1600
fix(settings): 处理 PR 审核意见 — 验证失败文案 / 切换回滚 / 计时器依赖
May 22, 2026
15b4fb1
fix(net): 超时不重试 + 网络探针单发 — 处理 PR-Agent 评审意见
May 22, 2026
2056ad8
Merge branch 'beta' into feat/settings-revamp
May 22, 2026
0689442
test(polish): 更新 structured prompt 测试以匹配重写后的事项数规则
May 22, 2026
038744f
fix(marketplace): 登录成功写 prefs 失败时补回 .catch
May 22, 2026
74be27d
fix(settings): provider 切换失败按后端是否已切来决定下拉框回滚
May 22, 2026
8986c56
fix(settings): performSwitch 补 catch — 本地 ASR 切换失败不再裸抛
May 22, 2026
00b2bd0
fix(settings): ProvidersSection 识别 sherpa-onnx-local 本地引擎
May 22, 2026
99f22a6
fix: ASR 切换强制覆盖 endpoint/model + 重试只限连接层失败
May 22, 2026
1b8217e
Merge pull request #521 from Open-Less/feat/settings-revamp
appergb May 22, 2026
529ec77
Fix Sherpa local ASR state sync
weikeyi May 22, 2026
cd9696d
Fix active ASR settings sync ordering
weikeyi May 23, 2026
75a5082
Tighten Qwen3 tokenizer cache validation
weikeyi May 23, 2026
6d6510f
Address Sherpa PR review feedback
weikeyi May 23, 2026
81a48b9
Fix Sherpa local ASR asset and state handling
weikeyi May 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
421 changes: 421 additions & 0 deletions docs/windows-sherpa-onnx-asr-plan.md

Large diffs are not rendered by default.

75 changes: 68 additions & 7 deletions openless-all/app/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions openless-all/app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ tauri-plugin-autostart = "2"
tauri-plugin-dialog = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.10"
bzip2 = "0.4"
tar = "0.4"
tokio = { version = "1", features = ["full"] }
tokio-tungstenite = { version = "0.24", features = ["rustls-tls-native-roots"] }
futures-util = "0.3"
Expand Down Expand Up @@ -81,6 +84,7 @@ libc = "0.2"
[target.'cfg(target_os = "windows")'.dependencies]
foundry-local-sdk = { version = "1.1.0", features = ["winml"] }
raw-window-handle = "0.6"
sherpa-onnx = { version = "1.13.2", default-features = false, features = ["static"] }
windows = { version = "0.58", features = [
"Win32_Foundation",
"Win32_Globalization",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ mod asr {
}
}
}

pub mod sherpa {
pub const DEFAULT_MODEL_ALIAS: &str = "sense-voice-small-zh";
pub const PROVIDER_ID: &str = "sherpa-onnx-local";

pub fn is_sherpa_onnx_local(id: &str) -> bool {
id == PROVIDER_ID
}
}
}
}

Expand Down
22 changes: 22 additions & 0 deletions openless-all/app/src-tauri/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
fn main() {
#[cfg(target_os = "windows")]
link_windows_common_controls_v6_manifest_dependency();

#[cfg(target_os = "macos")]
build_qwen_asr_macos();

tauri_build::build();
}

#[cfg(target_os = "windows")]
fn link_windows_common_controls_v6_manifest_dependency() {
let mut source_path = std::path::PathBuf::from(
std::env::var_os("OUT_DIR").expect("OUT_DIR must be set by Cargo"),
);
source_path.push("common-controls-v6-manifest-dependency.c");
std::fs::write(
&source_path,
r#"#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
int openless_common_controls_v6_manifest_dependency_anchor = 0;
"#,
)
.expect("write common controls manifest dependency source");
cc::Build::new()
.file(&source_path)
.compile("openless_common_controls_v6_manifest_dependency");
println!("cargo:rustc-link-arg=/INCLUDE:openless_common_controls_v6_manifest_dependency_anchor");
}

/// 编译 vendored Open-Less/qwen-asr 的 C 源(仅 macOS)。
///
/// 上游 Makefile `make blas` 等价配置:BLAS 加速通过 Accelerate framework,
Expand Down
7 changes: 5 additions & 2 deletions openless-all/app/src-tauri/src/asr/local/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl DownloadManager {
}
}

fn build_client() -> Result<reqwest::Client> {
pub(crate) fn build_client() -> Result<reqwest::Client> {
// native-tls (macOS=SecureTransport) 不像 rustls 那样把 CDN unclean close
// 当致命错误。
//
Expand Down Expand Up @@ -476,6 +476,9 @@ const PARALLEL_FILES: usize = 3;
pub fn partial_actual_size(partial: &Path) -> u64 {
let total_size = match std::fs::metadata(partial) {
Ok(m) => m.len(),
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
return 0;
}
Err(e) => {
eprintln!(
"[local-asr] partial_actual_size: stat partial failed ({}): {}",
Expand Down Expand Up @@ -525,7 +528,7 @@ pub fn partial_actual_size(partial: &Path) -> u64 {
total
}

async fn download_one(
pub(crate) async fn download_one(
client: &reqwest::Client,
url: &str,
dest: &Path,
Expand Down
4 changes: 2 additions & 2 deletions openless-all/app/src-tauri/src/asr/local/foundry_native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,12 @@ if ($readyForFoundryX64) { exit 0 } else { exit 1 }
fn windows_app_runtime_detection_requires_complete_package_set() {
let script = super::windows_app_runtime_detection_script();

assert!(script.contains("Microsoft.WindowsAppRuntime.1.8"));
assert!(script.contains("Microsoft\\.WindowsAppRuntime\\.1\\.8"));
assert!(script.contains("frameworkX86"));
assert!(script.contains("frameworkX64"));
assert!(script.contains("readyForFoundryX64"));
assert!(script.contains("completeX64MachineRuntime"));
assert!(script.contains("Main.1.8"));
assert!(script.contains("Main\\.1\\.8"));
assert!(script.contains("Singleton"));
assert!(script.contains("ddlmX86"));
assert!(script.contains("ddlmX64"));
Expand Down
14 changes: 12 additions & 2 deletions openless-all/app/src-tauri/src/asr/local/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//! 本地 ASR 引擎入口。
//!
//! 当前只在 macOS 编入 vendored Open-Less/qwen-asr (纯 C + Accelerate);Windows 端
//! 的本地推理路径见 issue #256,本期不实现。
//! 当前本地引擎:
//! - **macOS**:`antirez/qwen-asr` 纯 C + Accelerate(`local_provider` / `qwen_engine`)
//! - **Windows**:Foundry Local Whisper(`foundry_*`),以及 sherpa-onnx-local
//! 实验 provider(`sherpa*`,M1 仅骨架,详见 `docs/windows-sherpa-onnx-asr-plan.md`)

pub mod cache;
pub mod download;
Expand All @@ -11,13 +13,21 @@ pub mod foundry_provider;
pub mod foundry_runtime;
mod local_provider;
pub mod models;
pub mod sherpa;
pub mod sherpa_download;
pub mod sherpa_provider;
pub mod sherpa_runtime;
pub mod test_run;

pub use cache::LocalAsrCache;
#[allow(unused_imports)]
pub use foundry_provider::FoundryLocalWhisperAsr;
#[allow(unused_imports)]
pub use foundry_runtime::FoundryLocalRuntime;
#[allow(unused_imports)]
pub use sherpa_provider::SherpaOnnxAsr;
#[allow(unused_imports)]
pub use sherpa_runtime::SherpaOnnxRuntime;

#[cfg(target_os = "macos")]
mod qwen_engine;
Expand Down
Loading
Loading