ShmuelRonen / hebrew_whisper

Hebrew whisper powerful transcription and translation tool
MIT License
55 stars 6 forks source link

שגיאה #5

Closed start-life closed 7 months ago

start-life commented 7 months ago

RuntimeError: Cannot load audio from file: ffprobe not found. Please install ffmpeg in your system to use non-WAV audio file formats and make sure ffprobe is in your PATH. למה צריך להוריד את זה לPATH זה כבר מותקן לי בתור חבילת PIP אם תוכל לעשות שזה ישתמש בחבילת PIP

start-life commented 7 months ago

ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 407, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 69, in call return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\fastapi\applications.py", line 1054, in call await super().call(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\middleware\errors.py", line 186, in call raise exc File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in call await self.app(scope, receive, _send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\middleware\cors.py", line 85, in call await self.app(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 65, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app raise exc File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\routing.py", line 756, in call await self.middleware_stack(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\routing.py", line 776, in app await route.handle(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\routing.py", line 297, in handle await self.app(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app raise exc File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\routing.py", line 75, in app await response(scope, receive, send) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\responses.py", line 352, in call await send( File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette_exception_handler.py", line 50, in sender await send(message) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette_exception_handler.py", line 50, in sender await send(message) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\starlette\middleware\errors.py", line 161, in _send await send(message) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 504, in send output = self.conn.send(event=h11.Data(data=data)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\h11_connection.py", line 469, in send data_list = self.send_with_data_passthrough(event) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\h11_connection.py", line 502, in send_with_data_passthrough writer(event, data_list.append) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\h11_writers.py", line 77, in call self.send_data(event.data, write) File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\h11_writers.py", line 97, in send_data raise LocalProtocolError("Too much data for declared Content-Length") h11._util.LocalProtocolError: Too much data for declared Content-Length C:\zxcv\hebrew_whisper\venv\Lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning) Traceback (most recent call last): File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\gradio\processing_utils.py", line 337, in audio_from_file audio = AudioSegment.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\pydub\audio_segment.py", line 728, in from_file info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\pydub\utils.py", line 274, in mediainfo_json res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\z5050\miniconda3\Lib\subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\z5050\miniconda3\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 above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\gradio\queueing.py", line 495, in call_prediction output = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\gradio\route_utils.py", line 233, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\gradio\blocks.py", line 1604, in process_api inputs = await anyio.to_thread.run_sync( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\anyio_backends_asyncio.py", line 2144, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\anyio_backends_asyncio.py", line 851, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\gradio\blocks.py", line 1335, in preprocess_data processed_input.append(block.preprocess(inputs_cached)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\gradio\components\audio.py", line 205, in preprocess sample_rate, data = processing_utils.audio_from_file(temp_file_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\zxcv\hebrew_whisper\venv\Lib\site-packages\gradio\processing_utils.py", line 347, in audio_from_file raise RuntimeError(msg) from e RuntimeError: Cannot load audio from file: ffprobe not found. Please install ffmpeg in your system to use non-WAV audio file formats and make sure ffprobe is in your PATH.

ShmuelRonen commented 7 months ago

Fix issue with non .wav files

udiland commented 7 months ago

Hi, I still get this error

ShmuelRonen commented 7 months ago

can you upload to here the audio file that make this error

ShmuelRonen commented 7 months ago

Add ffmpeg-python to requirements.txt

udiland commented 7 months ago

Thank you for the quick reply, I tried it with direct recording. Anyway I have installed ffmpeg and I get no errors I am not sure if its working because Its currently running for more than 2000 seconds for a 31 seconds file.. BTW I hade another error that I fixed with: https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources

ShmuelRonen commented 7 months ago

I uploaded now an updated version of app.py which fixed a bug in handling long audio files.