File size: 642 Bytes
46f9144
6197f01
46f9144
 
6197f01
46f9144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from __future__ import annotations

import importlib.util
from pathlib import Path


def _load_gradio_module():
    module_path = Path(__file__).resolve().parent / "app" / "gradio_app.py"
    spec = importlib.util.spec_from_file_location("gradio_app_module", module_path)
    if spec is None or spec.loader is None:
        raise RuntimeError(f"Impossible de charger {module_path}")
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)
    return module


_gradio = _load_gradio_module()
demo = _gradio.create_interface()


if __name__ == "__main__":
    demo.launch(server_name="0.0.0.0", server_port=7860)