cptsubtext
commited on
Commit
·
c5caf73
1
Parent(s):
9b689e3
fix torch permission issue
Browse files
app.py
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
-
import streamlit as st
|
2 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import json
|
4 |
from PIL import Image
|
5 |
from transformers import LlavaForConditionalGeneration, AutoProcessor
|
|
|
|
|
1 |
import os
|
2 |
+
|
3 |
+
# Fix for Hugging Face Spaces / Streamlit permission issues
|
4 |
+
os.environ["STREAMLIT_CONFIG_DIR"] = "/tmp/.streamlit"
|
5 |
+
os.environ["STREAMLIT_CACHE_DIR"] = "/tmp/.cache"
|
6 |
+
os.environ["STREAMLIT_DISABLE_LOGGING"] = "1"
|
7 |
+
os.environ["STREAMLIT_LOG_LEVEL"] = "error"
|
8 |
+
os.makedirs("/tmp/.streamlit", exist_ok=True)
|
9 |
+
os.makedirs("/tmp/.cache", exist_ok=True)
|
10 |
+
|
11 |
+
import streamlit as st
|
12 |
import json
|
13 |
from PIL import Image
|
14 |
from transformers import LlavaForConditionalGeneration, AutoProcessor
|