Can't read in audio files for transcription
Hello, I am trying to import my own personal audio file to pass through a whisper pipeline and output the transcription. My code looks like this so far:import torchimport gradio as grimport soundfile as sffrom IPython.display import Audiofrom transformers import pipelineimport numpyimport ffmpegdevice = “cuda:0” if torch.cuda.is_available() else “cpu”pipe = pipeline(“automatic-speech-recognition”, model=“openai/whisper-large-v3”, device=device)def transcribe_speech(filepath):output = pipe(filepath,max_new_tokens=256,generate_kwargs={“task”: “transcribe”,},chunk_length_s=30,batch_size=8,)return output[“text”]transcribe_speech(“example2.mp3”)Most of this was copied directly from the HF Audio course, but even though I’ve donepip install ffmpegimport ffmpegWhenever I try and run the code I get “ValueError: ffmpeg was not found but is required to load audio files from filename”
2024-06-20T16:35:00Z
I’ve tried online fixes such as downloading FFMPEG directly and placing the .exe file into my PATH, but nothing seems to be working
2024-06-29T07:39:28Z
I have the same issue!! Please, help