solve https://github.com/QuentinFuxa/whisper_streaming_web/issues/60#issuecomment-2692191781
Browse files
whisper_fastapi_online_server.py
CHANGED
|
@@ -49,7 +49,7 @@ parser.add_argument(
|
|
| 49 |
parser.add_argument(
|
| 50 |
"--diarization",
|
| 51 |
type=bool,
|
| 52 |
-
default=
|
| 53 |
help="Whether to enable speaker diarization.",
|
| 54 |
)
|
| 55 |
|
|
@@ -329,7 +329,7 @@ async def results_formatter(shared_state, websocket):
|
|
| 329 |
"speaker": 1,
|
| 330 |
"text": "",
|
| 331 |
"beg": format_time(0),
|
| 332 |
-
"end": format_time(
|
| 333 |
"diff": 0
|
| 334 |
}],
|
| 335 |
"buffer_transcription": buffer_transcription,
|
|
|
|
| 49 |
parser.add_argument(
|
| 50 |
"--diarization",
|
| 51 |
type=bool,
|
| 52 |
+
default=False,
|
| 53 |
help="Whether to enable speaker diarization.",
|
| 54 |
)
|
| 55 |
|
|
|
|
| 329 |
"speaker": 1,
|
| 330 |
"text": "",
|
| 331 |
"beg": format_time(0),
|
| 332 |
+
"end": format_time(tokens[-1].end) if tokens else format_time(0),
|
| 333 |
"diff": 0
|
| 334 |
}],
|
| 335 |
"buffer_transcription": buffer_transcription,
|