Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import torch
|
| 2 |
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
| 3 |
from datasets import load_dataset
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
# Set the cache directory to a writable directory
|
| 4 |
+
cache_dir = "/tmp/huggingface_cache" # Contoh direktori yang bisa ditulis
|
| 5 |
+
if not os.path.exists(cache_dir):
|
| 6 |
+
os.makedirs(cache_dir, exist_ok=True)
|
| 7 |
+
os.environ["TRANSFORMERS_CACHE"] = cache_dir
|
| 8 |
+
|
| 9 |
import torch
|
| 10 |
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
| 11 |
from datasets import load_dataset
|