feat: 模型下载源改为 CNB 优先 GitHub 回退 - #2721
Closed
kawayiYokami wants to merge 1 commit into
Closed
Conversation
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 Walkthrough新增
变更
移除
WalkthroughChangesCNB 下载源与备用下载流程
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ModelComponent as YOLO模型组件
participant OnnxModelLoader
participant CNB
participant GitHub
ModelComponent->>OnnxModelLoader: 传入主地址和备用地址
OnnxModelLoader->>CNB: 下载主模型
alt CNB 下载失败
OnnxModelLoader->>GitHub: 下载备用模型
end
OnnxModelLoader-->>ModelComponent: 返回下载结果
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
为什么改(why)
模型下载此前只走 GitHub/Gitee,国内网络下容易失败。CNB(腾讯云)上有 OneDragon-YOLO 与 OneDragon-Env 的完整镜像(已实测可下载),Gitee 上没有模型镜像,属于无效源。
本 PR 把模型下载源改为 CNB 优先 → GitHub 回退,去掉 Gitee。CNB 下载无需代理,国内直连速度快。
改动要点(what)
CommonDownloaderParam.cnb_release_download_url字段;CommonDownloader.download增加download_by_cnb参数,支持多源按 CNB → GitHub → Gitee → Mirror酱 顺序自动回退(某源失败自动尝试下一个);CNB 不走 ghproxy,GitHub 仍可走get_cnb_model_download_url(YOLO)、get_ocr_download_url_cnb(OCR),URL 为https://cnb.cool/.../-/releases/download/...(注意带/-/路径段,不带会 404)OnnxModelLoader支持备用下载地址,失败自动切换basic_model_config.get_ocr_opts/onnx_ocr_matcher/zzz_contextOCR v6 后台下载同步更新get_ocr_download_url_gitee函数、YOLO_GITEE_MODEL_DOWNLOAD_URL、param 中的 gitee URL)验证
.../OneDragon-YOLO/-/releases/download/zzz_model/yolov8n-640-flash-20250921.zip、OCR.../OneDragon-Env/-/releases/download/ppocrv6/ppocrv6.zip均 302→206 可下载ruff check通过(无新增错误)