File size: 954 Bytes
dafcd87 63139fb dafcd87 63139fb dafcd87 63139fb dafcd87 63139fb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #!/usr/bin/env python3
"""
Launcher for MedGemma-Micro Interactive Test & Chat Interface
============================================================
Boots FastAPI / Uvicorn server and provides terminal access link.
"""
import os
import sys
# Auto-delegate to .venv/bin/python if running outside virtual environment
venv_python = os.path.abspath(os.path.join(os.path.dirname(__file__), ".venv", "bin", "python"))
if os.path.exists(venv_python) and os.path.realpath(sys.executable) != os.path.realpath(venv_python):
os.execv(venv_python, [venv_python] + sys.argv)
import uvicorn
if __name__ == "__main__":
port = 8000
host = "127.0.0.1"
print("=" * 65)
print(f"Starting MedGemma-Micro Interactive Test Interface")
print(f"Model: medgemma_micro_cardio_350m.tflite (MacBook M2 LiteRT)")
print(f"URL: http://{host}:{port}")
print("=" * 65)
uvicorn.run("app:app", host=host, port=port, log_level="info", reload=False)
|