Spaces:
Build error
Build error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +7 -8
src/streamlit_app.py
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
import plotly.express as px
|
|
@@ -6,15 +13,7 @@ import traceback # Import traceback for detailed error info
|
|
| 6 |
import altair as alt
|
| 7 |
# Import functions from main.py
|
| 8 |
from main import analyze_text, visualize_results
|
| 9 |
-
import os
|
| 10 |
-
|
| 11 |
-
# Set huggingface cache to a local path
|
| 12 |
-
os.environ["TRANSFORMERS_CACHE"] = "./hf_cache"
|
| 13 |
-
os.environ["HF_HOME"] = "./hf_home"
|
| 14 |
-
os.environ["XDG_CACHE_HOME"] = "./.cache"
|
| 15 |
|
| 16 |
-
# Optional: prevent streamlit from writing to /
|
| 17 |
-
os.environ["STREAMLIT_HOME"] = "./.streamlit"
|
| 18 |
|
| 19 |
st.set_page_config(page_title="Text Analysis Module", layout="centered") # Use wide layout
|
| 20 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
# Set cache dirs to writable local folders
|
| 4 |
+
os.environ["TRANSFORMERS_CACHE"] = "./hf_cache"
|
| 5 |
+
os.environ["HF_HOME"] = "./hf_home"
|
| 6 |
+
os.environ["XDG_CACHE_HOME"] = "./.cache"
|
| 7 |
+
|
| 8 |
import streamlit as st
|
| 9 |
import pandas as pd
|
| 10 |
import plotly.express as px
|
|
|
|
| 13 |
import altair as alt
|
| 14 |
# Import functions from main.py
|
| 15 |
from main import analyze_text, visualize_results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
|
|
|
|
|
|
| 17 |
|
| 18 |
st.set_page_config(page_title="Text Analysis Module", layout="centered") # Use wide layout
|
| 19 |
|