From f7f1f259c12d803fcb8f6486d1143f18d22e9acf Mon Sep 17 00:00:00 2001 From: Quentin Fuxa Date: Fri, 7 Feb 2025 12:25:05 +0100 Subject: [PATCH] buffer is now transcript.text --- whisper_fastapi_online_server.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/whisper_fastapi_online_server.py b/whisper_fastapi_online_server.py index 4c06117..7138fa4 100644 --- a/whisper_fastapi_online_server.py +++ b/whisper_fastapi_online_server.py @@ -213,16 +213,12 @@ async def websocket_endpoint(websocket: WebSocket): full_transcription += trans if args.vac: - buffer = online.online.concatenate_tsw( - online.online.transcript_buffer.buffer - )[ - 2 - ] # We need to access the underlying online object to get the buffer + transcript = online.online.concatenate_tokens(online.online.transcript_buffer.buffer) else: - buffer = online.concatenate_tsw(online.transcript_buffer.buffer)[2] - if ( - buffer in full_transcription - ): # With VAC, the buffer is not updated until the next chunk is processed + transcript = online.concatenate_tokens(online.transcript_buffer.buffer) + + buffer = transcript.text + if buffer in full_transcription: # With VAC, the buffer is not updated until the next chunk is processed buffer = "" lines = [