-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_ui.py
More file actions
31 lines (26 loc) · 892 Bytes
/
run_ui.py
File metadata and controls
31 lines (26 loc) · 892 Bytes
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
29
30
31
#!/usr/bin/env python3
"""
DocThinker UI launcher.
Usage:
python run_ui.py
"""
import os
import sys
_ROOT = os.path.abspath(os.path.dirname(__file__))
os.chdir(_ROOT)
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from docthinker.ui.app import app, config
if __name__ == "__main__":
host = getattr(config, "ui_host", "0.0.0.0")
port = getattr(config, "ui_port", 5000)
print()
print(" ========================================")
print(" DocThinker UI")
print(" ========================================")
print(" Chat: http://127.0.0.1:{}/query".format(port))
print(" KG: http://127.0.0.1:{}/knowledge-graph".format(port))
print(" KG alias: http://127.0.0.1:{}/kg-viz".format(port))
print(" ========================================")
print()
app.run(host=host, port=port, debug=False, use_reloader=False)