Skip to content

Commit

Permalink
fix: convert segment failed
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwantaozi committed Nov 26, 2024
1 parent f9c81c4 commit 0042567
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions vox_box/backends/stt/faster_whisper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import dataclasses
import json
import logging
import os
Expand Down Expand Up @@ -125,12 +124,11 @@ def transcribe(
text_buffer.write(seg.text)

if not without_timestamps:

if word_timestamps:
for wd in seg.words:
timestamps.append(dataclasses.asdict(wd))
timestamps.append(wd._asdict())
else:
timestamps.append(dataclasses.asdict(seg))
timestamps.append(seg._asdict())

text = text_buffer.getvalue()
if without_timestamps:
Expand Down

0 comments on commit 0042567

Please sign in to comment.