fix: update openapi code to match updated return type
This commit is contained in:
parent
2de090023c
commit
e3dc524783
1 changed files with 4 additions and 4 deletions
|
|
@ -192,17 +192,17 @@ class OpenaiApiASR(ASRBase):
|
||||||
|
|
||||||
o = []
|
o = []
|
||||||
for word in segments.words:
|
for word in segments.words:
|
||||||
start = word.get("start")
|
start = word.start
|
||||||
end = word.get("end")
|
end = word.end
|
||||||
if any(s[0] <= start <= s[1] for s in no_speech_segments):
|
if any(s[0] <= start <= s[1] for s in no_speech_segments):
|
||||||
# print("Skipping word", word.get("word"), "because it's in a no-speech segment")
|
# print("Skipping word", word.get("word"), "because it's in a no-speech segment")
|
||||||
continue
|
continue
|
||||||
o.append((start, end, word.get("word")))
|
o.append((start, end, word.word))
|
||||||
return o
|
return o
|
||||||
|
|
||||||
|
|
||||||
def segments_end_ts(self, res):
|
def segments_end_ts(self, res):
|
||||||
return [s["end"] for s in res.words]
|
return [s.end for s in res.words]
|
||||||
|
|
||||||
def transcribe(self, audio_data, prompt=None, *args, **kwargs):
|
def transcribe(self, audio_data, prompt=None, *args, **kwargs):
|
||||||
# Write the audio data to a buffer
|
# Write the audio data to a buffer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue