Whisper API respnse issue

If I assign text, vtt format , API return this “error” . ( not final output looks fine)

File “/Users/chunwencheng/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py”, line 671, in _interpret_response_line
raise error.APIError(
openai.error.APIError: HTTP code 200 from API (WEBVTT

code:
transcript = openai.Audio.transcribe(“whisper-1”, audio_file,response_format=“vtt”)

If we use default JSON, no such issue.
How can we make this “error message” away?

1 Like

Having the same issue, have tried running it in a try except block, tried treating the response as text, etc. have you had any luck?

Still have no good luck! Maybe exception is only one way now.

Yeah, it seems like it’s always expecting JSON (which return Content-Type: “application/json”) and doesn’t allow for the other formats (which return Content-Type: “text/plain”).

In the meantime, if you use the curl method, you can get the result correctly.

Having the same problem here.

I am able to do it using requests, but not using the openai library. This can be a temporary solution while the error is still present: syntax error - On Whisper API, when I try to use a python script for transcribing audio files in bulk, I can't get the correct response_format ('srt' or 'vtt') work - Stack Overflow

1 Like