File size: 653 Bytes
6f61bb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44ab35c
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
import os
import threading
import time
import webbrowser

from digester.gradio_ui_service import GradioUIService
from digester.util import get_config

os.makedirs("analyzer_logs", exist_ok=True)


def opentab_with_delay(port):
    def open():
        time.sleep(2)
        webbrowser.open_new_tab(f"http://localhost:{port}/?__theme=dark")

    threading.Thread(target=open, name="open-browser", daemon=True).start()


if __name__ == '__main__':
    config = get_config()
    port = config["gradio"]["port"]
    opentab_with_delay(port)
    demo = GradioUIService.get_gradio_ui()
    demo.queue(concurrency_count=config['gradio']['concurrent']).launch()