Another003 commited on
Commit
9012865
·
verified ·
1 Parent(s): 36a7777

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -0
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