Work Notes: Using OpenAI’s Whisper for Speech to Text

New Day: Fri Dec 23 2022 21:36:39 GMT-0600 (Central Standard Time)

I am tried of being on Mint Linux and having poor speech to text capability so I am going to make a web app and host it on this site.

I am using this repo as a starting point.

And I found that repo by looking through the show and tell page of OpenAI’s official repo.

When I set it up viz. install the python scripts and then run the right python file it gives me an error code 500 internal server error.

In detail:

NFO: - "GET / HTTP/1.1" 200 OK
INFO: - "GET /main.css HTTP/1.1" 200 OK
/home/monte/.local/lib/python3.8/site-packages/whisper/ UserWarning: FP16 is not supported on CPU; using FP32 instead
  warnings.warn("FP16 is not supported on CPU; using FP32 instead")
INFO: - "POST / HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/monte/.local/lib/python3.8/site-packages/uvicorn/protocols/http/", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/home/monte/.local/lib/python3.8/site-packages/uvicorn/middleware/", line 78, in __call__
    return await, receive, send)
  File "/home/monte/.local/lib/python3.8/site-packages/fastapi/", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/middleware/", line 184, in __call__
    raise exc
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/middleware/", line 162, in __call__
    await, receive, _send)
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/middleware/", line 75, in __call__
    raise exc
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/middleware/", line 64, in __call__
    await, receive, sender)
  File "/home/monte/.local/lib/python3.8/site-packages/fastapi/middleware/", line 21, in __call__
    raise e
  File "/home/monte/.local/lib/python3.8/site-packages/fastapi/middleware/", line 18, in __call__
    await, receive, send)
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/", line 680, in __call__
    await route.handle(scope, receive, send)
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/", line 275, in handle
    await, receive, send)
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/", line 65, in app
    response = await func(request)
  File "/home/monte/.local/lib/python3.8/site-packages/fastapi/", line 231, in app
    raw_response = await run_endpoint_function(
  File "/home/monte/.local/lib/python3.8/site-packages/fastapi/", line 162, in run_endpoint_function
    return await run_in_threadpool(, **values)
  File "/home/monte/.local/lib/python3.8/site-packages/starlette/", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/home/monte/.local/lib/python3.8/site-packages/anyio/", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/monte/.local/lib/python3.8/site-packages/anyio/_backends/", line 937, in run_sync_in_worker_thread
    return await future
  File "/home/monte/.local/lib/python3.8/site-packages/anyio/_backends/", line 867, in run
    result =, *args)
  File "/home/monte/Scratch/website_for_whisper/src/", line 30, in add_audio
    result = model.transcribe("audio.mp3")
  File "/home/monte/.local/lib/python3.8/site-packages/whisper/", line 84, in transcribe
    mel = log_mel_spectrogram(audio)
  File "/home/monte/.local/lib/python3.8/site-packages/whisper/", line 111, in log_mel_spectrogram
    audio = load_audio(audio)
  File "/home/monte/.local/lib/python3.8/site-packages/whisper/", line 42, in load_audio
    ffmpeg.input(file, threads=0)
  File "/home/monte/.local/lib/python3.8/site-packages/ffmpeg/", line 313, in run
    process = run_async(
  File "/home/monte/.local/lib/python3.8/site-packages/ffmpeg/", line 284, in run_async
    return subprocess.Popen(
  File "/usr/lib/python3.8/", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

Leave a Reply