Spaces:
Sleeping
Sleeping
fix cache permission issue
Browse files- src/detector.py +3 -0
src/detector.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
asr = pipeline("automatic-speech-recognition", model="openai/whisper-base")
|
| 4 |
|
| 5 |
def detect_accent(audio_path: str):
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
| 3 |
+
# Use local cache dir to avoid permission issues
|
| 4 |
+
os.environ["TRANSFORMERS_CACHE"] = "./hf_cache"
|
| 5 |
+
|
| 6 |
asr = pipeline("automatic-speech-recognition", model="openai/whisper-base")
|
| 7 |
|
| 8 |
def detect_accent(audio_path: str):
|