ffmpeg timout from 5 to 15s; diarization lag does not stay = 0 at the beginning
Browse files
whisper_fastapi_online_server.py
CHANGED
|
@@ -120,8 +120,7 @@ class SharedState:
|
|
| 120 |
remaining_time_transcription = max(0, round(current_time - self.beg_loop - self.end_buffer, 2))
|
| 121 |
|
| 122 |
# Calculate remaining time for diarization
|
| 123 |
-
if self.
|
| 124 |
-
remaining_time_diarization = max(0, round(max(self.end_buffer, self.tokens[-1].end if self.tokens else 0) - self.end_attributed_speaker, 2))
|
| 125 |
|
| 126 |
return {
|
| 127 |
"tokens": self.tokens.copy(),
|
|
@@ -420,7 +419,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 420 |
loop.run_in_executor(
|
| 421 |
None, ffmpeg_process.stdout.read, ffmpeg_buffer_from_duration
|
| 422 |
),
|
| 423 |
-
timeout=
|
| 424 |
)
|
| 425 |
except asyncio.TimeoutError:
|
| 426 |
logger.warning("FFmpeg read timeout. Restarting...")
|
|
|
|
| 120 |
remaining_time_transcription = max(0, round(current_time - self.beg_loop - self.end_buffer, 2))
|
| 121 |
|
| 122 |
# Calculate remaining time for diarization
|
| 123 |
+
remaining_time_diarization = max(0, round(max(self.end_buffer, self.tokens[-1].end if self.tokens else 0) - self.end_attributed_speaker, 2))
|
|
|
|
| 124 |
|
| 125 |
return {
|
| 126 |
"tokens": self.tokens.copy(),
|
|
|
|
| 419 |
loop.run_in_executor(
|
| 420 |
None, ffmpeg_process.stdout.read, ffmpeg_buffer_from_duration
|
| 421 |
),
|
| 422 |
+
timeout=15.0
|
| 423 |
)
|
| 424 |
except asyncio.TimeoutError:
|
| 425 |
logger.warning("FFmpeg read timeout. Restarting...")
|