tiny-press / app.py
sriharsha-cr's picture
Runtime enhancements 0.1
6102720
raw
history blame contribute delete
704 Bytes
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
if __name__ == "__main__":
demo = build_app()
demo.launch(
server_name="0.0.0.0",
server_port=config.SERVER_PORT,
show_error=True,
)