my python with whisper-1 works fine before using:
audio_file = open(“audio_in.mp3”, “rb”)
transcript = openai.Audio.transcribe(“whisper-1”, audio_file).
After upgraded openai from 0.27.8 to 1.2.0, running same python using:
from openai import OpenAI
client = OpenAI()
audio_file = open(“audio_in.mp3”, “rb”)
transcript = client.audio.transcriptions.create(
model=“whisper-1”,
file=audio_file
)
I got error message:
model=“whisper-1”,
^^^^^^^^^^^
TypeError: Transcriptions.create() takes 1 positional argument but 2 were given.
How to fix this?
1 Like
KSVq
November 14, 2023, 1:48am
3
I have had the same issue. Basically very simple code written based on provided api code samples but after cleaning it all up I had some extra brackets
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=audio_file
)
text = transcript['text']
That code works for me
2 Likes
Really works , python basics. Btw, I need to use .text instead of [‘text’]. Maybe I should get another version of python. I’m using 3.7.3.
Thanks for the above solutions, I fixed it by add a code:
transcript = client.audio.transcriptions.create(
model=“whisper-1”,
file=audio_file,
response_format=“text”
)