diff --git a/code/cep-plugin/main.js b/code/cep-plugin/main.js index f156d4d..d5dbd68 100755 --- a/code/cep-plugin/main.js +++ b/code/cep-plugin/main.js @@ -1853,10 +1853,9 @@ var SILENCE_DOWNLOAD_SCRIPT = "/Volumes/Merongo/SISTEMAS/WHISPERX/transcricao/do var SILENCE_DIARIZE_SCRIPT = "/Volumes/Merongo/SISTEMAS/WHISPERX/transcricao/diarize_cli.py"; var VOICE_FEATURES_SCRIPT = "/Volumes/Merongo/SISTEMAS/WHISPERX/transcricao/voice_features_cli.py"; var EDITORIAL_ACTIONS_APPLY_SCRIPT_FALLBACK = "/Volumes/Merongo/SISTEMAS/GENIAL SISTEMAS/Jhonny/code/scripts/apply-editorial-actions.mjs"; -// Catálogo dos tamanhos oficiais do faster-whisper hospedados pela Systran no -// Hugging Face (org consistente — outras variantes como distil-* e large-v3-turbo -// vivem em orgs diferentes com nomes de pasta inconsistentes, por isso ficam de fora -// por ora). Ordenado do mais rápido/impreciso ao mais lento/preciso. +// Catálogo dos modelos compatíveis com faster-whisper e aceitos pelo pipeline +// local. As variantes destilada e turbo também são suportadas pelo carregador, +// embora tenham organizações diferentes no Hugging Face. var MODEL_CATALOG = [ { value: "tiny", label: "Tiny", approxMB: 75 }, { value: "base", label: "Base", approxMB: 145 }, @@ -1865,6 +1864,8 @@ var MODEL_CATALOG = [ { value: "large-v1", label: "Large v1", approxMB: 3100 }, { value: "large-v2", label: "Large v2", approxMB: 3100 }, { value: "large-v3", label: "Large v3", approxMB: 3100 }, + { value: "large-v3-turbo", label: "Large v3 Turbo", approxMB: 1620 }, + { value: "distil-large-v3", label: "Distil Large v3", approxMB: 1500 }, ]; var DEFAULT_MODEL = "small"; @@ -3113,14 +3114,23 @@ function syncTranscribeModelSelect() { if (!select) return; var current = select.value; select.innerHTML = ""; - MODEL_CATALOG.forEach(function (m) { + var modelosDisponiveis = discoverPortugueseModelsOnMerongo(); + modelosDisponiveis.forEach(function (modelo) { var opt = document.createElement("option"); - opt.value = m.value; - opt.textContent = m.label; + opt.value = modelo.nome; + opt.textContent = modelo.nome + " · " + formatMB(modelo.tamanho); select.appendChild(opt); }); - var wanted = MODEL_CATALOG.some(function (m) { return m.value === current; }) ? current : loadDefaultModel(); - select.value = wanted; + if (!modelosDisponiveis.length) { + var vazio = document.createElement("option"); + vazio.value = ""; + vazio.textContent = "Nenhum modelo instalado"; + select.appendChild(vazio); + return; + } + var nomes = modelosDisponiveis.map(function (modelo) { return modelo.nome; }); + var desejado = nomes.indexOf(current) >= 0 ? current : loadDefaultModel(); + select.value = nomes.indexOf(desejado) >= 0 ? desejado : nomes[0]; } // ---- Settings tab: HF token ----