Replies: 1 comment 1 reply
-
Your problem is related to the fact that the Whisper model's transcribe function expects the path to the file, not the file itself. When you pass str(audio_path), you convert the path to a string, but do not provide the file itself. You need to pass the file name and then open it for reading. Try the following code: import whisper Replace "base" with the version of the model you want to usemodel = whisper.load_model("base") Transcribing an audiofile print(f"Success: moving to the transcription function {audio_path}") It is assumed that the result has already been processed and outputIn this code, we open the file for reading in binary mode ('rb') and pass the file object to the transcribe function. This will allow the Whisper model to read the data from the file and transcribe it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am rusty at coding novice at python workign with co-pilot ChatGPT
I am running the following code part of my python code
model = whisper.load_model("base")
result = model.transcribe(audio_path)
the debug messages show that the file is there:
(sucess: File found at C:\Users\saurabh\Desktop\python\EarningsCall.wav
sucess: moved into transcribe function C:\Users\saurabh\Desktop\python\EarningsCall.wav)
but then I get the error in the model.transcribe fucntion
file not found
File "C:\Program Files\Python312\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
the wav file is fine. I actually am using this from the OpenAI api site:-)
asked OpenAi chat it says everything looks fine, seems to be some sort of issue with whisper so I should post it here :-)
can anyone please help . thanks
Beta Was this translation helpful? Give feedback.
All reactions