import importlib.util import os import sys # Ensure project root is on sys.path ROOT = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, ROOT) # Load app/run.py as a module (no __init__.py needed) spec = importlib.util.spec_from_file_location("app_run", os.path.join(ROOT, "app", "run.py")) app_run = importlib.util.module_from_spec(spec) spec.loader.exec_module(app_run) ui = app_run.build_ui() ui.launch( server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)), )