fix(voice): 支持语音模型官方源与国内镜像切换 - #174
Merged
2977094657 merged 1 commit intoOct 2, 2026
Merged
2977094657 merged 1 commit into
2977094657 merged 1 commit into
Conversation
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.
关联 #173。当前语音模型列表下载直接使用 Hugging Face SDK,官方站连接超时时,用户无法在设置中切换来源。
本 PR 仅补充语音模型下载源切换:在「设置 → 语音转文字 → 模型下载源」选择官方 Hugging Face 或国内 HF-Mirror,选择自动保存,默认官方源。元数据和文件下载使用同一来源;切换只影响后续下载,不重建推理服务。保留原有固定版本、文件清单、校验、进度与取消流程。模型均为公开仓库,显式禁用隐式 HF 凭据,不修改全局 HF_ENDPOINT。
实测 HF-Mirror 在本次网络中对仓库请求返回 308 跳转至官方站,项目锁定的 SDK 无法直接处理此跨站 HEAD 跳转,因此增加了有界探测:仅遵循镜像返回的同仓库官方地址的 301/308,探测超时或其他目标仍保留所选源。没有增加自动失败切源、离线导入或其他模型功能。
验证:
额外检查:test_runtime_settings_env_file.py 的两个既有用例在 Windows 上于临时目录清理时报错(尚未恢复 cwd 就删除目录);用未修改的 origin/main runtime_settings.py 复现同样失败,本 PR 未修改这部分。
基于最新上游 main:6230a3f6。