Nicholas Bumgarner commited on
Commit
e73f64f
·
1 Parent(s): 6f7f402

Fix boot wait loop: release lock between checks, extended timeout

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -149,9 +149,8 @@ def boot_phoenix():
149
  )
150
  _update_boot("start", f"Phoenix PID {_phoenix_proc.pid} — loading model (~40s)...")
151
 
152
- # Phase 4: Wait for model load
153
- time.sleep(2)
154
- for i in range(60):
155
  if _phoenix_proc.poll() is not None:
156
  _update_boot("error", f"Phoenix exited early (code {_phoenix_proc.returncode})")
157
  return
@@ -161,6 +160,9 @@ def boot_phoenix():
161
  if "Chat Mode" in log:
162
  _update_boot("ready", "Phoenix ready — chat interface active!", ready=True)
163
  return
 
 
 
164
  except Exception:
165
  pass
166
  time.sleep(1)
 
149
  )
150
  _update_boot("start", f"Phoenix PID {_phoenix_proc.pid} — loading model (~40s)...")
151
 
152
+ # Phase 4: Wait for model load (non-blocking, releases lock between checks)
153
+ for i in range(90):
 
154
  if _phoenix_proc.poll() is not None:
155
  _update_boot("error", f"Phoenix exited early (code {_phoenix_proc.returncode})")
156
  return
 
160
  if "Chat Mode" in log:
161
  _update_boot("ready", "Phoenix ready — chat interface active!", ready=True)
162
  return
163
+ # Check for model load completion
164
+ if "Loaded" in log or "vocab" in log.lower():
165
+ _update_boot("ready", f"Loading... ({i}s)", ready=False)
166
  except Exception:
167
  pass
168
  time.sleep(1)