Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
f41a09e
1
Parent(s):
cdd9137
Remove redundant codes in fixing the HF space permission error.
Browse files
app.py
CHANGED
|
@@ -18,8 +18,10 @@ import zipfile
|
|
| 18 |
|
| 19 |
# Fix the HF space permission error when using from_pretrained(..., trust_remote_code=True)
|
| 20 |
hf_cache_path = '/tmp/hf_cache'
|
|
|
|
| 21 |
os.environ["HF_HOME"] = hf_cache_path
|
| 22 |
-
os.
|
|
|
|
| 23 |
|
| 24 |
import transformers
|
| 25 |
transformers.utils.move_cache()
|
|
|
|
| 18 |
|
| 19 |
# Fix the HF space permission error when using from_pretrained(..., trust_remote_code=True)
|
| 20 |
hf_cache_path = '/tmp/hf_cache'
|
| 21 |
+
os.environ["HUGGINGFACE_HUB_CACHE"] = hf_cache_path
|
| 22 |
os.environ["HF_HOME"] = hf_cache_path
|
| 23 |
+
os.environ["HF_MODULES_CACHE"] = os.path.join("/tmp/hf_cache", "modules")
|
| 24 |
+
os.makedirs(os.path.join("/tmp/hf_cache", "modules"), exist_ok=True)
|
| 25 |
|
| 26 |
import transformers
|
| 27 |
transformers.utils.move_cache()
|