Spaces:
Running
Running
Update audio_to_text.py
Browse files- audio_to_text.py +5 -10
audio_to_text.py
CHANGED
@@ -4,16 +4,11 @@ import torch
|
|
4 |
import os
|
5 |
from pydub import AudioSegment
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
#
|
11 |
-
|
12 |
-
# Add this path to the PATH environment variable
|
13 |
-
os.environ["PATH"] += os.pathsep + ffmpeg_bin_path
|
14 |
-
# Ensure ffmpeg is in PATH
|
15 |
-
AudioSegment.converter = os.path.join(ffmpeg_bin_path, 'ffmpeg.exe')
|
16 |
-
|
17 |
|
18 |
# load model and processor
|
19 |
processor = WhisperProcessor.from_pretrained("openai/whisper-small")
|
|
|
4 |
import os
|
5 |
from pydub import AudioSegment
|
6 |
|
7 |
+
# Install the specific version of FFmpeg
|
8 |
+
os.system("apt-get update")
|
9 |
+
os.system("apt-get install -y ffmpeg=7:6.1.1-3ubuntu5")
|
10 |
+
# Verify the installed version of FFmpeg
|
11 |
+
os.system("ffmpeg -version")
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
# load model and processor
|
14 |
processor = WhisperProcessor.from_pretrained("openai/whisper-small")
|