bluestpanda commited on
Commit
a827599
·
1 Parent(s): a539629

Fix Streamlit configuration for Hugging Face Spaces and clean up imports

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -2
  2. app.py +1 -5
Dockerfile CHANGED
@@ -15,5 +15,5 @@ COPY app.py /app/app.py
15
  # Expose Streamlit port
16
  EXPOSE 7860
17
 
18
- # Run Streamlit
19
- CMD ["streamlit", "run", "/app/app.py", "--server.address", "0.0.0.0", "--server.port", "7860"]
 
15
  # Expose Streamlit port
16
  EXPOSE 7860
17
 
18
+ # Run Streamlit with proper configuration for Hugging Face Spaces
19
+ CMD ["streamlit", "run", "/app/app.py", "--server.address", "0.0.0.0", "--server.port", "7860", "--server.headless", "true", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false"]
app.py CHANGED
@@ -12,11 +12,7 @@ from pathlib import Path
12
  from typing import Dict, Any
13
  import io
14
 
15
- try:
16
- import requests
17
- except ImportError:
18
- st.error("Error: requests module not found. Please install it with: pip install requests")
19
- st.stop()
20
 
21
  # Try to import structure_analysis, fallback to inline if not available
22
  try:
 
12
  from typing import Dict, Any
13
  import io
14
 
15
+ import requests
 
 
 
 
16
 
17
  # Try to import structure_analysis, fallback to inline if not available
18
  try: