File size: 854 Bytes
7f683f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

# 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)