Skip to content

ci: 无头识别用的两个模型改从 Actions 缓存取 - #118

Merged
sunerpy merged 1 commit into
mainfrom
ci/smoke-model-cache
Oct 6, 2026
Merged

sunerpy merged 1 commit into
mainfrom
ci/smoke-model-cache

Conversation

@sunerpy

@sunerpy sunerpy commented Oct 6, 2026

Copy link
Copy Markdown
Owner

摘要

2026-10-06,main 的 Intel 腿在无头识别下载 SenseVoice 时失败(run 37401697547):huggingface.co 和 hf-mirror.com 在 45 秒内都连不上,下载停在 0%。这两个模型每次 CI 都要现下载,合计约 930 MB,网络一出问题 main 就会变红,下一个候选包也过不了门禁。

  • scripts/smoke-native-cli.ps1 新增 -ModelCache
    • 运行前把缓存里的模型文件复制进模型库,不带 manifest.json。应用的下载器照常核对大小和 sha256,缺的或核对不过的才下载。
    • 跑通后把核对过的文件放回缓存。
    • 模型库的位置按应用的规则推出:ProjectDirs 的数据目录加 models。推出的位置和应用实际安装的位置不一致时会记一条提示,此时不影响正确性,只是缓存起不到作用。
  • ci.yml:windows-native、smoke-desktop、macos 三个 job 共用一份跨系统缓存。
    • 键为 smoke-models-<catalogue.rs 的哈希>,.gitattributes 统一了 LF,所以各系统算出的键相同。
    • 只从 main 写入;PR 只读取。

测试

  • scripts/release/test_release_workflows.py:新增 test_regression_the_smoke_models_come_from_the_actions_cache,改动前 3 个 job 都失败,改动后通过。

  • 本机 debug 版实跑四种情况:

    情况 结果
    有缓存 通过,34 秒,没有下载
    有缓存,网络切断 通过
    无缓存,网络切断 在下载这一步失败
    缓存文件被改动,网络切断 下载器报 wrong sha256 后重新下载,因断网而失败
  • make verify:65fc0cca 上所有门禁通过,dirty_paths=0。

  • macOS 腿已手动派发 CI 验证。

ci: 类型,不需要发版。

2026-10-06 huggingface.co 和 hf-mirror.com 同时连不上,main 的 Intel 腿在下载
SenseVoice 时失败(run 37401697547)。smoke-native-cli.ps1 新增 -ModelCache:
运行前把缓存里的模型文件复制进模型库(不带 manifest.json),由应用的下载器核对
大小和 sha256,缺的或核对不过的才下载;成功后把核对过的文件放回缓存。
windows-native、smoke-desktop 和 macos 三个 job 共用一份跨系统缓存(键为
catalogue.rs 的哈希),只从 main 写入。
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
+ Coverage   93.48%   93.50%   +0.01%     
==========================================
  Files         354      354              
  Lines       49506    49506              
  Branches     3216     3216              
==========================================
+ Hits        46283    46292       +9     
+ Misses       2808     2800       -8     
+ Partials      415      414       -1     
Flag Coverage Δ
rust 93.55% <ø> (+0.01%) ⬆️
web 93.31% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit 0eeb620 into main Oct 6, 2026
31 checks passed
@sunerpy
sunerpy deleted the ci/smoke-model-cache branch October 6, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant