Spaces:
Runtime error
Runtime error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -0
src/streamlit_app.py
CHANGED
@@ -2,6 +2,10 @@ import os
|
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
|
|
|
|
|
|
|
|
|
5 |
# Use local cache directory to avoid permission issues
|
6 |
os.environ['TRANSFORMERS_CACHE'] = '/app/cache'
|
7 |
|
|
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
|
5 |
+
port = int(os.environ.get("PORT", 7860))
|
6 |
+
st.set_page_config(page_title="Text Classifier")
|
7 |
+
st.write(f"Running on port {port} (for Hugging Face)")
|
8 |
+
|
9 |
# Use local cache directory to avoid permission issues
|
10 |
os.environ['TRANSFORMERS_CACHE'] = '/app/cache'
|
11 |
|