transcripts taking a very long time #263
-
Hi, I'm using the pre-recorded transcription API and I'm making some requests that are taking a really long time, like 5 minutes for a 2 minute audio clip. What's the best way to debug this? Is this because some of the transcription options are expensive (topics/entities/summarize?) or could a mimetype issue cause this? Open to any ideas |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @swiecki can you tell us more about your API request? Long response times are not typical unless Whisper is being used, in which case the transcription takes much longer than a model like Nova. Below is some useful info for us to know:
|
Beta Was this translation helpful? Give feedback.
-
Hi @jjmaldonis thanks so much for your reply and suggestions on how I can start to debug this issue. here is an example request ID from a request earlier today: I think its very possible I'm not handling my mimetypes / encodings correctly, could that be causing it? I'm using the deepgram python library: audio_filename = info["path"]
mimetype = "audio/" + info["ext"]
to_return = {}
with open(audio_filename, "rb") as audio_file:
source = {
"buffer": audio_file,
"mimetype": mimetype,
}
print(source)
response = await dg_client.transcription.prerecorded(
source,
{
"punctuate": True,
"smart_format": True,
"profanity_filter": True,
"detect_topics": True,
"detect_entities": True,
"summarize": True,
"model": "nova",
"keywords": info["title"].split(" "),
},
) |
Beta Was this translation helpful? Give feedback.
Yes,
audio/m4a
is an invalid mimetype, m4a files should useaudio/mp4
. That could cause the slowdown.Your code looks good.
It may be worth trying different file formats, which will help you narrow down whether the issue is related to the mimetype or file format. Here is an ffmpeg command that will convert file formats:
ffmpeg -i your_audio.m4a -c copy output.wav
- you can change the file extension ofoutput.wav
to anything you want. Make sure to change the mimetype when making the request with the new file format.