禁用段落最大句数限制
parent
41ba571188
commit
e905aefc94
|
|
@ -1030,9 +1030,6 @@ class Qwen3ASRService:
|
|||
)
|
||||
return int(window_sec * 16000)
|
||||
|
||||
def _max_sentence_count(self, ctx: ConnectionContext) -> int:
|
||||
return max(int(ctx.params.get("max_sentence_count", 8) or 8), 1)
|
||||
|
||||
def _max_partial_text_chars(self, ctx: ConnectionContext) -> int:
|
||||
return max(
|
||||
int(
|
||||
|
|
@ -2953,7 +2950,6 @@ class Qwen3ASRService:
|
|||
"pre_roll_ms",
|
||||
settings.REALTIME_VAD_PRE_ROLL_MS,
|
||||
),
|
||||
"max_sentence_count": payload.get("max_sentence_count", 8),
|
||||
"max_partial_text_chars": payload.get(
|
||||
"max_partial_text_chars",
|
||||
ctx.DEFAULT_MAX_PARTIAL_TEXT_CHARS,
|
||||
|
|
@ -3232,15 +3228,8 @@ class Qwen3ASRService:
|
|||
)
|
||||
ctx.state = ConnectionState.STREAMING
|
||||
|
||||
if self._sentence_count(visible_observed) >= self._max_sentence_count(ctx):
|
||||
await self._commit_retranscribe_turn(
|
||||
websocket,
|
||||
ctx,
|
||||
task_id,
|
||||
"sentence_limit",
|
||||
)
|
||||
continue
|
||||
|
||||
# Follow FunASR's VAD-driven segment lifecycle; punctuation count
|
||||
# should not force an otherwise active realtime speech segment to commit.
|
||||
if self._should_commit_complete_sentence(ctx, visible_observed):
|
||||
await self._commit_retranscribe_turn(
|
||||
websocket,
|
||||
|
|
|
|||
|
|
@ -2188,10 +2188,6 @@
|
|||
<label for="livePreRollMs">句首预读时长(pre_roll_ms)</label>
|
||||
<input id="livePreRollMs" type="number" min="0" step="20" value="240">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="liveMaxSentenceCount">单段最多句数(max_sentence_count)</label>
|
||||
<input id="liveMaxSentenceCount" type="number" min="1" step="1" value="8">
|
||||
</div>
|
||||
<label class="switch">说话人分离 <input id="liveEnableSpeaker" type="checkbox" checked></label>
|
||||
<label class="switch">匹配声纹库 <input id="liveMatchSpeakerRegistry" type="checkbox" checked></label>
|
||||
<div class="field">
|
||||
|
|
@ -3932,7 +3928,6 @@ ${transcript}
|
|||
silence_duration_ms: Number($("liveSilenceDurationMs").value || 800),
|
||||
min_partial_sec: Number($("liveMinPartialSec").value || 0.3),
|
||||
pre_roll_ms: Number($("livePreRollMs").value || 240),
|
||||
max_sentence_count: Number($("liveMaxSentenceCount").value || 8),
|
||||
partial_holdback_chars: Number($("livePartialHoldbackChars").value || 2),
|
||||
enable_native_partial_stream: $("liveEnableNativePartialStream").checked,
|
||||
enable_speaker: $("liveEnableSpeaker").checked,
|
||||
|
|
|
|||
Loading…
Reference in New Issue