

Merge branch 'main' of github.com:promet99/whisper_streaming into promet99-main
@c42dc8bafff91a9a4d7e2a78280f981d2f340caf
--- whisper_online.py
+++ whisper_online.py
... | ... | @@ -192,17 +192,17 @@ |
192 | 192 |
|
193 | 193 |
o = [] |
194 | 194 |
for word in segments.words: |
195 |
- start = word.get("start") |
|
196 |
- end = word.get("end") |
|
195 |
+ start = word.start |
|
196 |
+ end = word.end |
|
197 | 197 |
if any(s[0] <= start <= s[1] for s in no_speech_segments): |
198 | 198 |
# print("Skipping word", word.get("word"), "because it's in a no-speech segment") |
199 | 199 |
continue |
200 |
- o.append((start, end, word.get("word"))) |
|
200 |
+ o.append((start, end, word.word)) |
|
201 | 201 |
return o |
202 | 202 |
|
203 | 203 |
|
204 | 204 |
def segments_end_ts(self, res): |
205 |
- return [s["end"] for s in res.words] |
|
205 |
+ return [s.end for s in res.words] |
|
206 | 206 |
|
207 | 207 |
def transcribe(self, audio_data, prompt=None, *args, **kwargs): |
208 | 208 |
# Write the audio data to a buffer |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?