Skip to content

Local Transcribe 1.5.0-beta.5 — macOS + Windows

Pre-release
Pre-release

Choose a tag to compare

@TimmySheep TimmySheep released this 28 Oct 12:37
· 20 commits to main since this release

Local Transcribe 1.5.0-beta.5

中文

这次修复一个退出时闪退的严重 bug。

修复:加载过本地 AI 模型后,退出应用会闪退

现象:用过「询问 AI」之后退出应用,进程以 SIGABRT 结束(崩溃报告显示 GGML_ASSERT([rsets->data count] == 0) failed,ggml-metal-device.m:1040)。没加载过模型时退出正常,所以看起来像随机崩溃。

根因:应用退出时,事件循环结束后框架直接调用 std::process::exit,Rust 的析构函数不会被调用。于是已经加载的大模型(以及它占用的 Metal 显存资源)从来没有被释放;进程真正退出时,C++ 静态析构要释放 Metal 设备,发现还有资源没归还,ggml 直接断言失败并 abort。换成直白的话:不是转写或生成时出错,而是「关应用」这一步没把模型交还干净。

修复:退出流程现在会在进程结束前先取消正在进行的生成、同步卸载模型,再正常退出。生成到一半直接退出也不会崩,模型资源会被正确释放。

Windows 版同样使用这条退出路径(Windows 用的是 CPU 推理、没有 Metal 断言,因此不会出现同样的崩溃),这次也一并保证退出前释放模型。

验证

  • 用真实 Qwen3-1.7B 模型复现:旧行为(加载后直接退出)稳定触发同一断言、exit 134;修复后退出码 0,包括「生成进行中直接退出」的场景。
  • cargo test --workspace、cargo clippy -D warnings、npm run check(0/0)、npm test(119/119)全部通过;Windows 由 CI 构建与测试。

English

One crash fix in this build.

Fixed: quitting the app crashed after the local AI model had been used

Symptom: after using "Ask AI", quitting the app ended in SIGABRT (GGML_ASSERT([rsets->data count] == 0) failed, ggml-metal-device.m:1040). Quitting without ever loading a model was fine, which made it look random.

Root cause: on quit the event loop ends inside the framework, which then calls std::process::exit. Rust destructors never run, so the loaded language model and the Metal resources it holds are never released. When the process actually exits, C++ static destructors tear down the Metal device, find resources still outstanding, and ggml asserts and aborts. In plain terms: the crash was in the shutdown path, not in transcription or generation.

Fix: the exit path now cancels any in-flight generation and unloads the model synchronously before the process ends, so quitting mid-generation is safe too. Windows uses the same exit path (it runs CPU inference and never hit the Metal assertion); it now releases the model on exit as well.

Verification

  • Reproduced with the real Qwen3-1.7B model: the previous behaviour aborts with the exact assertion seen in the crash reports (exit 134); the fixed path exits with code 0, including a run that quits while tokens are still being generated.
  • cargo test --workspace, cargo clippy -D warnings, npm run check (0/0) and npm test (119/119) pass; Windows is built and tested by CI.