File size: 1,000 Bytes
3573a39
b8e1457
58c39e0
9e4233f
3573a39
58c39e0
be473e6
3573a39
8f809e2
b8e1457
8f809e2
 
 
b8e1457
8f809e2
5b8d6d5
2861b85
7487fdb
8092547
beb62dc
b8e1457
3573a39
8f809e2
 
9ca668d
8f809e2
 
 
1c00552
b8e1457
 
1c00552
8f809e2
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
32
33
34
import atexit
import traceback

import gradio as gr

from app_debug import get_demo as get_demo_debug
from app_leaderboard import get_demo as get_demo_leaderboard
from app_text_classification import get_demo as get_demo_text_classification
from run_jobs import start_process_run_job, stop_thread
from wordings import TITLE_MD, FOOTER_HTML

try:
    with gr.Blocks(theme=gr.themes.Soft(primary_hue="green")) as demo:
        gr.Markdown(TITLE_MD)
        with gr.Tab("Text Classification"):
            get_demo_text_classification()
        with gr.Tab("Leaderboard") as leaderboard_tab:
            get_demo_leaderboard(leaderboard_tab)
        with gr.Tab("Logs(Debug)"):
            get_demo_debug()
        gr.HTML(FOOTER_HTML)

    start_process_run_job()

    demo.queue(max_size=1000)
    demo.launch(share=False)
    atexit.register(stop_thread)

except Exception as e:
    # Print stack trace back
    print(traceback.format_exc())
    print("stop background thread: ", e)
    stop_thread()