What is the better way to set a timeout on the transcribe method? #264
Unanswered
ElvisFDias
asked this question in
Q&A
Replies: 1 comment
-
Hi, The transcribe method returns a generator so a basic approach would be to exit the loop reading the segments. For example: segments, _ = model.transcribe("audio.mp3")
timeout = 10 # in seconds
start = time.time()
for segment in segments:
print(segment)
if time.time() - start >= timeout:
break However, with this method the transcription will not stop exactly at the configured timeout. It can only stop after generating a segment. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I've created a web api to transcribe short audio files, and I need to set a timeout on the process transcribe.
Someone know what's the better way to do this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions