File size: 690 Bytes
ebc3bf5
 
 
 
6ea3105
 
 
 
 
 
ebc3bf5
 
 
 
77105ca
 
 
ebc3bf5
 
 
b9f16c6
 
ebc3bf5
b9f16c6
3c1707e
 
b9f16c6
47fd22c
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
import gradio as gr
import config
from ui.compress_tab import build_compress_tab
from ui.history_tab import build_history_tab
from models.model_loader import get_tokenizer_only

try:
    get_tokenizer_only()  # pre-warm; first keystroke is instant
except Exception:
    pass  # falls back to lazy load on first keystroke


def build_app() -> gr.Blocks:
    with gr.Blocks(title=config.APP_TITLE) as app:
        run_store = gr.State(value=[])
        build_compress_tab(run_store)
        build_history_tab(run_store)
    return app


demo = build_app()

if __name__ == "__main__":
    demo.launch(
        share=False,
        server_port=config.SERVER_PORT,
        ssr_mode=False,
    )