Download app.py from build-small-hackathon/tiny-press: direct link, hf CLI and curl.
- Browser
- Download file 704 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/tiny-press/resolve/refs%2Fpr%2F6/app.py
- Command line
-
hf download hf://spaces/build-small-hackathon/tiny-press@refs/pr/6/app.py
-
curl -L -o app.py https://huggingface.co/spaces/build-small-hackathon/tiny-press/resolve/refs%2Fpr%2F6/app.py
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, | |
| ) | |