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