I’m trying to make an auto video thing using the whisper module. I can’t figure out how to access non-python files in python.
Code is here:
import whisper # type: ignore
model = whisper.load_model("base")
result = model.transcribe("./AutoYoutubeVid/TestThing.mp3")
print(f' The text in video: n {result["text"]}')
I’ve looked stuff up, nothing helpful. I’ve tried saying “TestThing.mp3”, “AutoYoutubeVid/TestThing.mp3” the full directory, and what was in the code block but it all gave me an error basically saying it couldn’t find the file. I have checked that the file is in that exact directory, and it was.
Error here:
C:UsersCENSOREDAppDataLocalProgramsPythonPython311Libsite-packageswhispertranscribe.py:115: 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 "c:UsersCENSOREDOneDriveDesktopPython ProjectsAutoYoutubeVidAuto make a youtube video thing idk man.py", line 4, in <module>
result = model.transcribe("AutoYoutubeVid/TestThing")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython311Libsite-packageswhispertranscribe.py", line 122, in transcribe
mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython311Libsite-packageswhisperaudio.py", line 140, in log_mel_spectrogram
audio = load_audio(audio)
^^^^^^^^^^^^^^^^^
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython311Libsite-packageswhisperaudio.py", line 58,
in load_audio
out = run(cmd, capture_output=True, check=True).stdout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython311Libsubprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython311Libsubprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython311Libsubprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
1