Whisper API, How to upload file that larger than 25mb – API


I code in typescript, I try to make a simple web app that can convert video/audio to transcripts by open-ai whisper API, the Whisper API only supports files that are less than 25 MB, so I split them into chunks if they’re too large, and then transcribe the audio into text, but have error, heres what error output:

Error in getTranscript: AxiosError: Request failed with status code 400 Error: Cannot set headers after they are sent to the client

Hi!
Are you making two separate calls to the API, each with their own chunk?
Because then you would send the headers for each request which should resolve the issue, if it is just two files.
You need to re-add the transcripts after you returned the results.

Also, you can check this resource from the forum:



2 Likes

Another useful strategy will be to chunk it with overlap.

Figure about 10-seconds–30-seconds of overlap to ensure good coverage.

I kind of confuse about what you mean for “Because then you would send the headers for each request “, do you mean add header for each chunks?



Source link

Leave a Comment