File size: 502 Bytes
bd2cac7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)),
)