Team Ai
Apppublic

IDKHowToCodeFr/tinyml-backend

sourceHugging Faceupdated 6h agoView on Hugging Face
1likes
app.py21 linesDownload Raw Back to root
1import subprocess2import os3import sys4import time5 6# 1. Start FastAPI backend in background7print("Starting FastAPI backend...")8backend_process = subprocess.Popen(9    [sys.executable, "-m", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]10)11 12# Give backend some time to start13time.sleep(5)14 15# 2. Start Streamlit frontend16print("Starting Streamlit frontend...")17os.environ["API_URL"] = "http://localhost:8000"18subprocess.run(19    ["streamlit", "run", "frontend/Home.py", "--server.port", "7860", "--server.address", "0.0.0.0"]20)21