Spaces:
Sleeping
Sleeping
# main.py | |
# Entry point for the Chat Chassidus RAG application | |
import os | |
import subprocess | |
import sys | |
# This file serves as an entry point to run the Streamlit app | |
# The actual application logic is in app.py | |
if __name__ == "__main__": | |
# Run the Streamlit app with specific port and address for Replit | |
# Disable WebSocket compression and CORS to prevent connection issues | |
os.environ["STREAMLIT_SERVER_PORT"] = "8501" # Use port forwarded to 80 | |
os.environ["STREAMLIT_SERVER_ADDRESS"] = "localhost" | |
os.environ["STREAMLIT_SERVER_HEADLESS"] = "true" | |
os.environ["STREAMLIT_SERVER_ENABLE_WEBSOCKET_COMPRESSION"] = "false" | |
os.environ["STREAMLIT_SERVER_ENABLE_CORS"] = "false" | |
os.environ["STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION"] = "false" | |
subprocess.run([sys.executable, "-m", "streamlit", "run", "app.py"], check=True) | |