LovnishVerma commited on
Commit
93a00cf
·
verified ·
1 Parent(s): 210dd01

Upload 43 files

Browse files
Files changed (2) hide show
  1. src/main.py +2 -2
  2. src/vision/florence.py +3 -0
src/main.py CHANGED
@@ -10,8 +10,8 @@ def main():
10
  print(f"Starting {CONFIG.APP_NAME} v{CONFIG.APP_VERSION}")
11
 
12
  assistant = SightLineAssistant()
13
- # Load model in background thread for instant UI rendering
14
- threading.Thread(target=assistant.initialize, daemon=True).start()
15
 
16
  demo = build_ui(assistant)
17
 
 
10
  print(f"Starting {CONFIG.APP_NAME} v{CONFIG.APP_VERSION}")
11
 
12
  assistant = SightLineAssistant()
13
+ # Load model synchronously for ZeroGPU compatibility
14
+ assistant.initialize()
15
 
16
  demo = build_ui(assistant)
17
 
src/vision/florence.py CHANGED
@@ -83,6 +83,9 @@ class FlorenceVisionEngine(VisionEngine):
83
 
84
  def _warmup(self):
85
  """Run a dummy inference to warm up kernels."""
 
 
 
86
  try:
87
  dummy = Image.new("RGB", (224, 224), 128)
88
  self._run_inference(dummy, "<CAPTION>")
 
83
 
84
  def _warmup(self):
85
  """Run a dummy inference to warm up kernels."""
86
+ if IS_SPACES:
87
+ print("Skipping warmup on ZeroGPU Spaces")
88
+ return
89
  try:
90
  dummy = Image.new("RGB", (224, 224), 128)
91
  self._run_inference(dummy, "<CAPTION>")