Show all STT/TTS backends with ✓/✗ status in conversation dropdowns
Replaces the filter-to-available-only approach with full lists that include unavailable backends (disabled, marked ✗) so users can see what's broken. Also extends STT retry fallback to cover HTTP 500 from wrong model names (fixes faster-whisper CTranslate2 CUDA build issue). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ed24ff4f8f
commit
838445ba07
@ -1974,7 +1974,7 @@ def _transcribe_audio(src: Path, settings: dict, backend: str = "configured") ->
|
|||||||
headers=hdrs,
|
headers=hdrs,
|
||||||
timeout=_STT_REQUEST_TIMEOUT,
|
timeout=_STT_REQUEST_TIMEOUT,
|
||||||
)
|
)
|
||||||
if resp.status_code in {400, 404, 422} and model != "whisper-1":
|
if resp.status_code in {400, 404, 422, 500} and model != "whisper-1":
|
||||||
with src.open("rb") as f:
|
with src.open("rb") as f:
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
f"{stt_url}/v1/audio/transcriptions",
|
f"{stt_url}/v1/audio/transcriptions",
|
||||||
|
|||||||
@ -8227,12 +8227,27 @@ $('s-import-voices-file')?.addEventListener('change', async function () {
|
|||||||
// ── Populate STT backends ────────────────────────────────────────────────
|
// ── Populate STT backends ────────────────────────────────────────────────
|
||||||
async function loadConvSttBackends() {
|
async function loadConvSttBackends() {
|
||||||
if (!sttSel) return;
|
if (!sttSel) return;
|
||||||
|
const prev = sttSel.value;
|
||||||
try {
|
try {
|
||||||
const d = await fetch('/api/stt-backends').then(r => r.json());
|
const d = await fetch('/api/stt-backends').then(r => r.json());
|
||||||
const avail = (d.backends || []).filter(b => b.available);
|
const all = d.backends || [];
|
||||||
sttSel.innerHTML = avail.length
|
if (!all.length) {
|
||||||
? avail.map(b => `<option value="${escHtml(b.id)}">${escHtml(b.label)}</option>`).join('')
|
sttSel.innerHTML = '<option value="configured">Default (configured)</option>';
|
||||||
: '<option value="configured">Default (configured)</option>';
|
return;
|
||||||
|
}
|
||||||
|
sttSel.innerHTML = all.map(b => {
|
||||||
|
const icon = b.available ? '✓' : '✗';
|
||||||
|
const label = `${icon} ${escHtml(b.label)}`;
|
||||||
|
const disabled = !b.available;
|
||||||
|
return `<option value="${escHtml(b.id)}"${disabled ? ' disabled' : ''}>${label}</option>`;
|
||||||
|
}).join('');
|
||||||
|
// Restore prev selection or pick first available
|
||||||
|
const opt = sttSel.querySelector(`option[value="${CSS.escape(prev)}"]`);
|
||||||
|
if (opt && !opt.disabled) { sttSel.value = prev; }
|
||||||
|
else {
|
||||||
|
const first = sttSel.querySelector('option:not([disabled])');
|
||||||
|
if (first) sttSel.value = first.value;
|
||||||
|
}
|
||||||
} catch(_) {
|
} catch(_) {
|
||||||
sttSel.innerHTML = '<option value="configured">Default (configured)</option>';
|
sttSel.innerHTML = '<option value="configured">Default (configured)</option>';
|
||||||
}
|
}
|
||||||
@ -8241,10 +8256,22 @@ $('s-import-voices-file')?.addEventListener('change', async function () {
|
|||||||
// ── Populate TTS backends (reuse global _ttsBackends) ───────────────────
|
// ── Populate TTS backends (reuse global _ttsBackends) ───────────────────
|
||||||
function populateConvTtsBackends() {
|
function populateConvTtsBackends() {
|
||||||
if (!ttsBkSel) return;
|
if (!ttsBkSel) return;
|
||||||
const avail = availableTtsBackends();
|
const prev = ttsBkSel.value;
|
||||||
ttsBkSel.innerHTML = avail.length
|
const all = window._ttsBackends || [];
|
||||||
? avail.map(b => `<option value="${escHtml(b.id)}">${escHtml(b.label)}</option>`).join('')
|
if (!all.length) {
|
||||||
: '<option value="">No TTS backend available</option>';
|
ttsBkSel.innerHTML = '<option value="">No TTS backend available</option>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ttsBkSel.innerHTML = all.map(b => {
|
||||||
|
const icon = b.available ? '✓' : '✗';
|
||||||
|
return `<option value="${escHtml(b.id)}"${!b.available ? ' disabled' : ''}>${icon} ${escHtml(b.label)}</option>`;
|
||||||
|
}).join('');
|
||||||
|
const opt = ttsBkSel.querySelector(`option[value="${CSS.escape(prev)}"]`);
|
||||||
|
if (opt && !opt.disabled) { ttsBkSel.value = prev; }
|
||||||
|
else {
|
||||||
|
const first = ttsBkSel.querySelector('option:not([disabled])');
|
||||||
|
if (first) ttsBkSel.value = first.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Fetch LLM models ─────────────────────────────────────────────────────
|
// ── Fetch LLM models ─────────────────────────────────────────────────────
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user