Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- Dockerfile +1 -1
- app.py +0 -9
Dockerfile
CHANGED
|
@@ -11,4 +11,4 @@ COPY . .
|
|
| 11 |
RUN pip3 install -r requirements.txt
|
| 12 |
|
| 13 |
# Define the command to run the Streamlit app on port 8501 and make it accessible externally
|
| 14 |
-
CMD ["streamlit", "run", "app.py", "--server.port
|
|
|
|
| 11 |
RUN pip3 install -r requirements.txt
|
| 12 |
|
| 13 |
# Define the command to run the Streamlit app on port 8501 and make it accessible externally
|
| 14 |
+
CMD ["streamlit", "run", "app.py", "--server.port", "$PORT", "--server.address", "0.0.0.0", "--server.enableXsrfProtection=false"]
|
app.py
CHANGED
|
@@ -98,12 +98,3 @@ if file is not None:
|
|
| 98 |
except requests.exceptions.RequestException as e:
|
| 99 |
st.error(f"Error connecting to API: {str(e)}")
|
| 100 |
st.info("Please ensure your backend API is deployed and the URL is correct.")
|
| 101 |
-
|
| 102 |
-
import os
|
| 103 |
-
import streamlit.web.cli as stcli
|
| 104 |
-
import sys
|
| 105 |
-
|
| 106 |
-
if __name__ == "__main__":
|
| 107 |
-
port = int(os.environ.get("PORT", 7860))
|
| 108 |
-
sys.argv = ["streamlit", "run", "app.py", "--server.address", "0.0.0.0", "--server.port", str(port)]
|
| 109 |
-
sys.exit(stcli.main())
|
|
|
|
| 98 |
except requests.exceptions.RequestException as e:
|
| 99 |
st.error(f"Error connecting to API: {str(e)}")
|
| 100 |
st.info("Please ensure your backend API is deployed and the URL is correct.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|