sriharsha-cr commited on
Commit
3c1707e
·
1 Parent(s): 347f71b

Fix HF Space startup timeout: remove blocking model preload

Browse files

Downloading Qwen2.5-1.5B + MiniLM before app.launch() blocks the
Gradio server from starting within HF's ~5 min startup timeout.
Models are already lazily loaded on first request via model_loader.py.

Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio as gr
2
  import config
3
- from models.model_loader import get_llm, get_embedder
4
  from ui.compress_tab import build_compress_tab
5
  from ui.history_tab import build_history_tab
6
 
@@ -14,14 +13,8 @@ def build_app() -> gr.Blocks:
14
 
15
 
16
  if __name__ == "__main__":
17
- print("Loading models (first run may download weights)...")
18
- get_llm()
19
- get_embedder()
20
-
21
- print("Starting TinyPress...")
22
  app = build_app()
23
  app.launch(
24
- share = False,
25
- debug = True,
26
- server_port = config.SERVER_PORT
27
  )
 
1
  import gradio as gr
2
  import config
 
3
  from ui.compress_tab import build_compress_tab
4
  from ui.history_tab import build_history_tab
5
 
 
13
 
14
 
15
  if __name__ == "__main__":
 
 
 
 
 
16
  app = build_app()
17
  app.launch(
18
+ share=False,
19
+ server_port=config.SERVER_PORT,
 
20
  )