import os import subprocess # Determine which app to run based on an environment variable app_type = os.environ.get("APP_TYPE", "streamlit").lower() if app_type == "streamlit": # Start Streamlit subprocess.run(["streamlit", "run", "streamlit_app.py"]) elif app_type == "fastapi": # Start Uvicorn (FastAPI) subprocess.run(["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]) else: print(f"Unknown APP_TYPE: {app_type}")