qfuxa commited on
Commit
9076fea
·
1 Parent(s): 3ac7218

buffer is now transcript.text

Browse files
Files changed (1) hide show
  1. whisper_fastapi_online_server.py +5 -9
whisper_fastapi_online_server.py CHANGED
@@ -213,16 +213,12 @@ async def websocket_endpoint(websocket: WebSocket):
213
 
214
  full_transcription += trans
215
  if args.vac:
216
- buffer = online.online.concatenate_tsw(
217
- online.online.transcript_buffer.buffer
218
- )[
219
- 2
220
- ] # We need to access the underlying online object to get the buffer
221
  else:
222
- buffer = online.concatenate_tsw(online.transcript_buffer.buffer)[2]
223
- if (
224
- buffer in full_transcription
225
- ): # With VAC, the buffer is not updated until the next chunk is processed
226
  buffer = ""
227
 
228
  lines = [
 
213
 
214
  full_transcription += trans
215
  if args.vac:
216
+ transcript = online.online.concatenate_tokens(online.online.transcript_buffer.buffer)
 
 
 
 
217
  else:
218
+ transcript = online.concatenate_tokens(online.transcript_buffer.buffer)
219
+
220
+ buffer = transcript.text
221
+ if buffer in full_transcription: # With VAC, the buffer is not updated until the next chunk is processed
222
  buffer = ""
223
 
224
  lines = [