Spaces:
Running
Running
add permission
Browse files- src/streamlit_app.py +6 -0
src/streamlit_app.py
CHANGED
@@ -3,6 +3,12 @@ sys.modules['torch.classes'] = types.SimpleNamespace()
|
|
3 |
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
|
4 |
os.environ["STREAMLIT_WATCH_SYSTEM_FOLDERS"] = "false"
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
import streamlit as st
|
7 |
import torch
|
8 |
import numpy as np
|
|
|
3 |
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
|
4 |
os.environ["STREAMLIT_WATCH_SYSTEM_FOLDERS"] = "false"
|
5 |
|
6 |
+
# 🔒 Fix Hugging Face & cache permission errors on Hugging Face Spaces
|
7 |
+
os.environ["HF_HOME"] = "/tmp/huggingface"
|
8 |
+
os.environ["XDG_CACHE_HOME"] = "/tmp/.cache"
|
9 |
+
os.makedirs("/tmp/huggingface", exist_ok=True)
|
10 |
+
os.makedirs("/tmp/.cache", exist_ok=True)
|
11 |
+
|
12 |
import streamlit as st
|
13 |
import torch
|
14 |
import numpy as np
|