Update asr.py

This commit is contained in:
Chris 2025-02-18 11:33:29 +08:00 committed by GitHub
parent caa7352028
commit 5aae567ec3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@ import uuid
import opuslib
from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess
from core.utils.performance_monitor import track_performance
TAG = __name__
logger = setup_logging()
@ -65,6 +66,7 @@ class FunASR(ASR):
return file_path
@track_performance("ASR")
def speech_to_text(self, opus_data: List[bytes], session_id: str) -> Tuple[Optional[str], Optional[str]]:
"""语音转文本主处理逻辑"""
file_path = None