diff --git a/backend/routers/transcribe_v2.py b/backend/routers/transcribe_v2.py index 2272b5a90c2..126634b3874 100644 --- a/backend/routers/transcribe_v2.py +++ b/backend/routers/transcribe_v2.py @@ -315,7 +315,7 @@ async def transcript_consume(): nonlocal transcript_ws while websocket_active or len(segment_buffers) > 0: await asyncio.sleep(1) - if transcript_ws: + if transcript_ws and len(segment_buffers) > 0: try: # 100|data data = bytearray() @@ -346,7 +346,7 @@ async def audio_bytes_consume(): nonlocal audio_bytes_ws while websocket_active or len(audio_buffers) > 0: await asyncio.sleep(1) - if audio_bytes_ws: + if audio_bytes_ws and len(audio_buffers) > 0: try: # 101|data data = bytearray()