ZhengPeng7 commited on
Commit
28e6943
·
1 Parent(s): 1e48e62

Solve the x-net problem on no permission.

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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 when using from_pretrained(..., trust_remote_code=True)
 
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