(Dec-04-2022, 08:21 PM)needhelp Wrote: But I got the same error message whether it was on WindowsPowerShell or VScode.I have tested this this and it work as expected with a test.mp3 file.
I think indeed that the heart of the problem is the fact that it can't find the audio file.
How can I make it find it ?
You should be using virtual environment as it install a lot to avoid conflicts.
Example:
# Make G:\div_code λ python -m venv whisper_env # Cd in G:\div_code λ cd whisper_env\ # Activate G:\div_code\whisper_env λ G:\div_code\whisper_env\Scripts\activate.bat # Install (whisper_env) G:\div_code\whisper_env λ pip install git+https://github.com/openai/whisper.git Collecting ..... Successfully installed certifi-2022.9.24 charset-normalizer-2.1.1 colorama-0.4.6 ffmpeg-python-0.2.0 filelock-3.8.0 future-0.18.2 huggingface-hub-0.11.1 idna-3.4 more-itertools-9.0.0 numpy-1.23.5 packaging-21.3 pyparsing-3.0.9 pyyaml-6.0 regex-2022.10.31 requests-2.28.1 tokenizers-0.13.2 torch-1.13.0 tqdm-4.64.1 transformers-4.25.1 typing-extensions-4.4.0 urllib3-1.26.13 whisper-1.0Also install update, whisper setup .
(whisper_env) G:\div_code\whisper_env λ pip install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git Collecting ..... Successfully installed whisper-1.0Now if look in folder,use
dir
if ls
not work.(whisper_env) G:\div_code\whisper_env λ ls Connection Lib/ audio.wav audio.wav.txt pyvenv.cfg test.mp3.srt test.mp3.vtt Include/ Scripts/ audio.wav.srt audio.wav.vtt test.mp3 test.mp3.txt ws.pySee that i have
ws.py
and test.mp3
is in same folder.Run first:
(whisper_env) G:\div_code\whisper_env λ whisper test.mp3 .....The run code:
# ws.py import whisper model = whisper.load_model("base") result = model.transcribe("test.mp3") print(result["text"])
Output:(whisper_env) G:\div_code\whisper_env
λ python ws.py
Okay, we are trying this for a second time to test the ability to upload an MP3 file. Hopefully this will work.