Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,11 @@ from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
|
| 4 |
import soundfile as sf
|
| 5 |
import numpy as np
|
| 6 |
from scipy import signal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Load the Whisper model and processor directly from Hugging Face
|
| 9 |
def load_model():
|
|
|
|
| 4 |
import soundfile as sf
|
| 5 |
import numpy as np
|
| 6 |
from scipy import signal
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
+
# Set the cache directory to a writable location
|
| 10 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/.cache"
|
| 11 |
+
os.environ["HF_DATASETS_CACHE"] = "/tmp/.cache"
|
| 12 |
|
| 13 |
# Load the Whisper model and processor directly from Hugging Face
|
| 14 |
def load_model():
|