fix(morpheus): raise TTS max_tokens 1200->2400 (long lines clipped at ~14.6s)
Cut-offs were the max_tokens=1200 ceiling (~14.6s of audio), not memory (~1250 tokens << 4096 context). Diagnosis: the repetition penalty is load-bearing for clean stops — rep 1.0 => the model never emits end-of-speech and rambles to the cap; rep 1.1 (the wrapper default) => clean natural stop. So normal lines already complete; only genuinely long dialogue (>~14.6s, ~25+ words) hit the cap. Raised default + client max_tokens to 2400 (~29s), still within the 4096 context (no memory cost). Verified: a 49-word line now finishes at 16.73s (was clipped at 14.6s).
This commit is contained in:
@@ -160,7 +160,7 @@ async function streamSpeak(speech, tag){
|
||||
const url = $('ttsUrl').value.trim().replace(/\/+$/,'').replace(/\/tts$/,'') + '/tts/stream';
|
||||
const res = await fetch(url, {
|
||||
method:'POST', headers:{ 'Content-Type':'application/json' },
|
||||
body: JSON.stringify({ text: speech, voice: ($('ttsVoice').value.trim() || 'baddy'), max_tokens: 1200 })
|
||||
body: JSON.stringify({ text: speech, voice: ($('ttsVoice').value.trim() || 'baddy'), max_tokens: 2400 })
|
||||
});
|
||||
if (!res.ok || !res.body){ tag.textContent = ' 🔇' + res.status; return; }
|
||||
const reader = res.body.getReader();
|
||||
|
||||
@@ -45,8 +45,10 @@ class TTSReq(BaseModel):
|
||||
voice: str = DEFAULT_VOICE
|
||||
temperature: float = 0.6
|
||||
top_p: float = 0.95
|
||||
max_tokens: int = 1200
|
||||
repetition_penalty: float = 1.1 # keep <=1.1 for cloning (higher penalizes ref audio tokens)
|
||||
max_tokens: int = 2400 # ~29s of audio; long lines were clipping at 1200 (~14.6s)
|
||||
repetition_penalty: float = 1.1 # LOAD-BEARING: rep 1.0 => model never stops (rambles to
|
||||
# the cap); rep 1.1 => clean end-of-speech. Keep <=1.1 for
|
||||
# cloning (higher penalizes the in-context ref audio tokens).
|
||||
reference_audio_b64: str | None = None # optional zero-shot clone: base64 WAV
|
||||
reference_text: str | None = None # transcript of the reference
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ async function streamSpeak(speech, tag){
|
||||
const url = $('ttsUrl').value.trim().replace(/\/+$/,'').replace(/\/tts$/,'') + '/tts/stream';
|
||||
const res = await fetch(url, {
|
||||
method:'POST', headers:{ 'Content-Type':'application/json' },
|
||||
body: JSON.stringify({ text: speech, voice: ($('ttsVoice').value.trim() || 'baddy'), max_tokens: 1200 })
|
||||
body: JSON.stringify({ text: speech, voice: ($('ttsVoice').value.trim() || 'baddy'), max_tokens: 2400 })
|
||||
});
|
||||
if (!res.ok || !res.body){ tag.textContent = ' 🔇' + res.status; return; }
|
||||
const reader = res.body.getReader();
|
||||
|
||||
Reference in New Issue
Block a user