XucroYuri 7be8a59e52 feat: add training model/sample browsing API + WebUI, relax ref audio duration
为 TTS More 工作台增加远程获取训练数据的能力,并解除参考音频时长的硬编码阻断。

API (api_v2.py, 端口 9880):
- GET  /models                       列出训练角色(exp_name)及匹配权重
- GET  /models/{name}/samples        列出训练样本(音频+参考文本), 含目录穿越校验
- GET  /status                       当前权重/版本/设备状态
- POST /upload_ref                   上传参考音频, 文件名白名单清洗

Gradio WebUI (inference_webui.py):
- 新增「训练角色选择」区域: 模型名下拉/刷新/自动匹配权重/样本下拉/预览/应用样本
- on_auto_select_weights 采用稳健写法: 仅返回 Dropdown 值, 由已有 .change
  绑定触发切换 (change_sovits_weights 是生成器, 手动消费会丢失组件更新)

时长硬编码解除 (3~10s 不再阻断):
- TTS_infer_pack/TTS.py:815       raise OSError -> print [Warning]
- inference_webui.py:853          raise OSError -> gr.Warning (建议性文案)
- inference_webui.py:1367         标签改为「推荐3~10秒」

依赖: requirements.txt 追加 python-multipart (/upload_ref 必需)

向后兼容: 现有 /tts /set_gpt_weights /set_sovits_weights 签名与返回不变,
TTS 推理 pipeline 本体逻辑未改。所有改动 py_compile 通过。
2026-07-07 11:32:14 +08:00
..
2026-06-16 21:46:53 +08:00
2025-11-28 22:02:03 +08:00
2025-11-28 22:02:03 +08:00
2025-11-28 21:36:57 +08:00