Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No text appearing in the browser #8

Closed
benvanwerkhoven opened this issue Feb 5, 2025 · 2 comments
Closed

No text appearing in the browser #8

benvanwerkhoven opened this issue Feb 5, 2025 · 2 comments

Comments

@benvanwerkhoven
Copy link

First of all thanks for making this interesting Firefox extension! I'm quite interested in using it, however, as it currently stands no text seems to appear in the browser.

In the console, I do get the following output:

2025-02-05 17:11:54,689 - INFO - Starting server with device: cuda
 * Serving Flask app 'server'
 * Debug mode: on
2025-02-05 17:11:54,739 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
2025-02-05 17:11:54,739 - INFO - Press CTRL+C to quit
2025-02-05 17:11:54,755 - INFO -  * Restarting with stat
2025-02-05 17:12:00,374 - INFO - Starting server with device: cuda
2025-02-05 17:12:00,399 - WARNING -  * Debugger is active!
2025-02-05 17:12:00,402 - INFO -  * Debugger PIN: 113-275-107
2025-02-05 17:13:24,970 - DEBUG - Saved temporary file: /tmp/tmpwyxfkrj3.wav
2025-02-05 17:13:24,996 - ERROR - Error during transcription: [Errno 2] No such file or directory: 'ffmpeg'
Traceback (most recent call last):
  File "/path//Speechfire/server.py", line 43, in transcribe
    result = model.transcribe(temp_audio_file.name, fp16=False, language=language)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ben/.pyenv/versions/py311/lib/python3.11/site-packages/whisper/transcribe.py", line 133, in transcribe
    mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ben/.pyenv/versions/py311/lib/python3.11/site-packages/whisper/audio.py", line 140, in log_mel_spectrogram
    audio = load_audio(audio)
            ^^^^^^^^^^^^^^^^^
  File "/home/ben/.pyenv/versions/py311/lib/python3.11/site-packages/whisper/audio.py", line 58, in load_audio
    out = run(cmd, capture_output=True, check=True).stdout
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ben/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ben/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/ben/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

2025-02-05 17:13:24,997 - DEBUG - Removed temporary file: /tmp/tmpwyxfkrj3.wav
2025-02-05 17:13:24,997 - INFO - 127.0.0.1 - - [05/Feb/2025 17:13:24] "POST /transcribe?lang=English HTTP/1.1" 500 -

I'm not sure where it goes wrong. It seems that it can find a file it is looking for.

I'm running Firefox under Windows, but the server is running under WSL. Perhaps that could be an issue here? If Firefox is supposed to write to a location that the server can read, then maybe they're currently writing to different locations?

@benvanwerkhoven
Copy link
Author

A little further digging revealed that I was simply missing a Linux utility program called 'ffmpeg' which is probably used by whisper internally to convert the audio file. I've installed this tool and now text is appearing.

It works! Thanks for building this!

@sasoder
Copy link
Collaborator

sasoder commented Feb 5, 2025

Hey Ben, glad you managed to solve the issue and that it's working for you! Didn't know whisper requires ffmpeg, will add it to the readme - thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants