Robust language detection + anti-hallucination
- 3-sample voting for auto-detect (start/middle/end of song) prevents lang switching mid-song - Lock detected language for full transcription - Anti-hallucination: condition_on_previous_text=False, temperature=0.0 - compression_ratio_threshold=2.4 (rejects repetitive hallucinations) - log_prob_threshold=-1.0 (rejects low-confidence segments) - no_speech_threshold=0.6 (more aggressive silence detection) - Default Whisper model changed: small → medium (better for all langs incl. Slavic)
This commit is contained in:
@@ -231,11 +231,11 @@
|
||||
<div>
|
||||
<label>Whisper model</label>
|
||||
<select id="model">
|
||||
<option value="tiny">tiny (najhitrejši)</option>
|
||||
<option value="tiny">tiny (najhitrejši, slabša natančnost)</option>
|
||||
<option value="base">base</option>
|
||||
<option value="small" selected>small (DE/EN, hitro)</option>
|
||||
<option value="medium">medium (priporočeno za SLO/HR/BS)</option>
|
||||
<option value="large-v3">large-v3 (najboljše, počasno)</option>
|
||||
<option value="small">small (DE/EN, hitro)</option>
|
||||
<option value="medium" selected>medium (privzeto, vsi jeziki)</option>
|
||||
<option value="large-v3">large-v3 (najbolje, počasno)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -353,10 +353,12 @@
|
||||
});
|
||||
|
||||
// ─── Auto-upgrade Whisper model za slovanske jezike ──
|
||||
// Privzeto je medium; če uporabnik specifično izbere SLO/HR/BS in je na manjšem modelu, upgrade
|
||||
$("#lang").addEventListener("change", e => {
|
||||
const slavicLangs = ["sl", "hr", "bs", "sr"];
|
||||
const currentModel = $("#model").value;
|
||||
if (slavicLangs.includes(e.target.value) && (currentModel === "tiny" || currentModel === "base" || currentModel === "small")) {
|
||||
const smallerModels = ["tiny", "base", "small"];
|
||||
if (slavicLangs.includes(e.target.value) && smallerModels.includes(currentModel)) {
|
||||
$("#model").value = "medium";
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user