transcribe: fix empty segments

Sometimes the whisper model generates segments with no words in them.
Skip these segments.
This commit is contained in:
2026-05-31 17:37:33 -05:00
parent cac2b14052
commit 52245658bc

View File

@@ -10,6 +10,8 @@ def transcribe(input_file, dev):
segments = []
for seg in result["segments"]:
words = seg["words"]
if not words:
continue
start = words[0]["start"]
end = words[-1]["end"]
segments.append(Segment(start, end, seg["text"].strip()))