MiscellaneousStuff / openai-whisper-cpu

Improving transcription performance of OpenAI Whisper for CPU based deployment
MIT License
237 stars 19 forks source link

whisper not found error #14

Open vinny-888 opened 1 year ago

vinny-888 commented 1 year ago

I have followed the steps in the readme but I cannot run whisper on Ubuntu

Command:

whisper  audio.wav --model large

Error:

Command 'whisper' not found, did you mean:
  command 'whipper' from deb whipper (0.9.0-7build1)
Try: sudo apt install <deb name>

Are there any instructions how to run this version after following the steps in the readme?

When I try to run the docker commands I also get errors

Command

docker build -t whisper-cpu .

Error:

Step 7/14 : RUN whisper --model medium dummy.wav; exit 0
 ---> Running in d3059c793d9e
100%|██████████████████████████████████████| 1.42G/1.42G [00:10<00:00, 145MiB/s]
/openai-whisper-cpu/whisper/whisper/transcribe.py:78: UserWarning: FP16 is not supported on CPU; using FP32 instead
  warnings.warn("FP16 is not supported on CPU; using FP32 instead")
Traceback (most recent call last):
  File "/openai-whisper-cpu/whisper/whisper/audio.py", line 42, in load_audio
    ffmpeg.input(file, threads=0)
  File "/usr/local/lib/python3.9/site-packages/ffmpeg/_run.py", line 325, in run
    raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/whisper", line 33, in <module>
    sys.exit(load_entry_point('whisper', 'console_scripts', 'whisper')())
  File "/openai-whisper-cpu/whisper/whisper/transcribe.py", line 307, in cli
    result = transcribe(model, audio_path, temperature=temperature, **args)
  File "/openai-whisper-cpu/whisper/whisper/transcribe.py", line 84, in transcribe
    mel = log_mel_spectrogram(audio)
  File "/openai-whisper-cpu/whisper/whisper/audio.py", line 111, in log_mel_spectrogram
    audio = load_audio(audio)
  File "/openai-whisper-cpu/whisper/whisper/audio.py", line 47, in load_audio
    raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e
RuntimeError: Failed to load audio: ffmpeg version 4.3.6-0+deb11u1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
dummy.wav: No such file or directory
MiscellaneousStuff commented 1 year ago

I think if you just create an empty file called dummy.wav it should work.