mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-12 02:20:18 +08:00
feat(transcriber): 默认 size 改 tiny + 切本地引擎前 confirm 模型下载
桌面端用户首次跑视频时挂在 fast-whisper 模型下载(默认 medium ~1.5GB), 两处改动: 1. backend/app/services/transcriber_config_manager.py: 默认 whisper_model_size 从 'medium' (~1.5GB) → 'tiny' (~75MB)。 新装用户没主动设置时不再被首次下载卡住;想要更高精度的用户去配置页主动切。 2. BillNote_frontend/src/pages/SettingPage/transcriber.tsx: handleSave 在保存前判断:选了 fast-whisper / mlx-whisper 且当前 size 在 modelStatuses 里既未下载也不在下载中 → window.confirm 弹一个体积提示, 推荐改用 Groq / 必剪 / 快手 等在线引擎;用户取消则不保存。 不改业务逻辑;零回归风险(已有用户 transcriber.json 里写了什么就还是什么)。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,28 @@ export default function Transcriber() {
|
||||
}, [modelStatuses, mlxModelStatuses, fetchModelsStatus])
|
||||
|
||||
const handleSave = async () => {
|
||||
// 切到本地 whisper 引擎且选了未下载的模型时,提前 confirm,避免用户保存后到首次任务才发现要下 GB 级模型
|
||||
if (isWhisperType(selectedType)) {
|
||||
const pool = selectedType === 'mlx-whisper' ? mlxModelStatuses : modelStatuses
|
||||
const target = pool.find(m => m.model_size === selectedModelSize)
|
||||
if (target && !target.downloaded && !target.downloading) {
|
||||
const sizeHint: Record<string, string> = {
|
||||
'tiny': '~75MB',
|
||||
'base': '~150MB',
|
||||
'small': '~500MB',
|
||||
'medium': '~1.5GB',
|
||||
'large-v3': '~3GB',
|
||||
'large-v3-turbo': '~1.6GB',
|
||||
}
|
||||
const ok = window.confirm(
|
||||
`选择 ${selectedType} / ${selectedModelSize} 后,首次转写时会下载该模型(${sizeHint[selectedModelSize] || '体积未知'})。\n` +
|
||||
`网络较差时容易中断;推荐改用 Groq / 必剪 / 快手 等在线引擎。\n\n` +
|
||||
'继续保存吗?',
|
||||
)
|
||||
if (!ok) return
|
||||
}
|
||||
}
|
||||
|
||||
setSaving(true)
|
||||
try {
|
||||
const payload: { transcriber_type: string; whisper_model_size?: string } = {
|
||||
|
||||
Reference in New Issue
Block a user