Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,14 @@ from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
|
4 |
import soundfile as sf
|
5 |
import numpy as np
|
6 |
from scipy import signal
|
|
|
7 |
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
|
11 |
def process_audio(audio_path):
|
12 |
waveform, sr = sf.read(audio_path)
|
|
|
4 |
import soundfile as sf
|
5 |
import numpy as np
|
6 |
from scipy import signal
|
7 |
+
import os
|
8 |
|
9 |
+
# Set up cache directory
|
10 |
+
os.environ['TRANSFORMERS_CACHE'] = '/code/.cache'
|
11 |
+
os.makedirs('/code/.cache', exist_ok=True)
|
12 |
+
|
13 |
+
processor = WhisperProcessor.from_pretrained("openai/whisper-large-v3", cache_dir='/code/.cache')
|
14 |
+
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v3", cache_dir='/code/.cache')
|
15 |
|
16 |
def process_audio(audio_path):
|
17 |
waveform, sr = sf.read(audio_path)
|