Improve online ASR processor
This commit is contained in:
parent
e144abbbc7
commit
e1823dd99c
3 changed files with 22 additions and 26 deletions
|
|
@ -262,9 +262,6 @@ class OnlineASRProcessor:
|
|||
logger.debug(
|
||||
f"Length of audio buffer now: {len(self.audio_buffer)/self.SAMPLING_RATE:.2f} seconds"
|
||||
)
|
||||
if self.global_time_offset:
|
||||
for token in committed_tokens:
|
||||
token = token.with_offset(self.global_time_offset)
|
||||
return committed_tokens, current_audio_processed_upto
|
||||
|
||||
def chunk_completed_sentence(self):
|
||||
|
|
@ -367,7 +364,7 @@ class OnlineASRProcessor:
|
|||
if self.tokenize:
|
||||
try:
|
||||
sentence_texts = self.tokenize(full_text)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
# Some tokenizers (e.g., MosesSentenceSplitter) expect a list input.
|
||||
try:
|
||||
sentence_texts = self.tokenize([full_text])
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ import logging
|
|||
import platform
|
||||
import time
|
||||
|
||||
from whisperlivekit.backend_support import (faster_backend_available,
|
||||
mlx_backend_available)
|
||||
from whisperlivekit.backend_support import faster_backend_available, mlx_backend_available
|
||||
from whisperlivekit.model_paths import detect_model_format, resolve_model_path
|
||||
from whisperlivekit.warmup import warmup_asr
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue