Spaces:
Running on Zero
Running on Zero
Commit ·
28e6943
1
Parent(s): 1e48e62
Solve the x-net problem on no permission.
Browse files
app.py
CHANGED
|
@@ -16,7 +16,8 @@ import requests
|
|
| 16 |
from io import BytesIO
|
| 17 |
import zipfile
|
| 18 |
|
| 19 |
-
# Fix the HF space permission error
|
|
|
|
| 20 |
os.environ["HF_MODULES_CACHE"] = os.path.join("/tmp/hf_cache", "modules")
|
| 21 |
|
| 22 |
import transformers
|
|
|
|
| 16 |
from io import BytesIO
|
| 17 |
import zipfile
|
| 18 |
|
| 19 |
+
# Fix the HF space permission error -- redirect ALL HF cache to a writable location
|
| 20 |
+
os.environ["HF_HOME"] = "/tmp/hf_cache"
|
| 21 |
os.environ["HF_MODULES_CACHE"] = os.path.join("/tmp/hf_cache", "modules")
|
| 22 |
|
| 23 |
import transformers
|