Fahimeh Orvati Nia
commited on
Commit
·
4697ca4
1
Parent(s):
ca9e6d3
Force HF cache to /tmp to prevent storage limit errors
Browse files
app.py
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import tempfile
|
| 3 |
from pathlib import Path
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
# Force cache to /tmp before any imports
|
| 3 |
+
os.environ['HF_HOME'] = '/tmp/huggingface'
|
| 4 |
+
os.environ['TRANSFORMERS_CACHE'] = '/tmp/huggingface/transformers'
|
| 5 |
+
os.environ['TORCH_HOME'] = '/tmp/torch'
|
| 6 |
+
|
| 7 |
import gradio as gr
|
| 8 |
import tempfile
|
| 9 |
from pathlib import Path
|