Paulhayes commited on
Commit
5957e23
·
verified ·
1 Parent(s): 458788d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -2097,6 +2097,8 @@ class Bootstrap:
2097
  self.hive_ready = threading.Event()
2098
  self.lite_core_ready = threading.Event()
2099
  self.voice_ready = threading.Event()
 
 
2100
  self.env: Optional[Dict] = None
2101
  self.app: Optional[gr.Blocks] = None # type: ignore
2102
  self.init_status: Dict[str, str] = {}
@@ -2193,10 +2195,18 @@ class Bootstrap:
2193
  """Initializes the fast, responsive lite core."""
2194
  print("[Bootstrap] Initializing Lite Hive Core...")
2195
  try:
2196
- self.hive_lite_instance = Hive(caps=self.caps, lite=True)
 
 
 
2197
  self.lite_core_ready.set()
 
2198
  except Exception as e:
2199
- print(f"[ERROR] Failed to initialize Lite Hive Core: {e}")
 
 
 
 
2200
  # In case of failure, we still set the event to not hang the UI.
2201
  self.lite_core_ready.set()
2202
 
@@ -2223,6 +2233,7 @@ class Bootstrap:
2223
 
2224
  # Wait for the main LLM and finalize full core
2225
  llm_thread.join()
 
2226
  self.hive_ready.set()
2227
  logging.info("Full Hive Core is ready.")
2228
 
 
2097
  self.hive_ready = threading.Event()
2098
  self.lite_core_ready = threading.Event()
2099
  self.voice_ready = threading.Event()
2100
+ self.lite_core_success = True
2101
+ self.lite_core_error_msg = ""
2102
  self.env: Optional[Dict] = None
2103
  self.app: Optional[gr.Blocks] = None # type: ignore
2104
  self.init_status: Dict[str, str] = {}
 
2195
  """Initializes the fast, responsive lite core."""
2196
  print("[Bootstrap] Initializing Lite Hive Core...")
2197
  try:
2198
+ # This now correctly creates the initial lite instance via the global function
2199
+ self.hive_lite_instance = Hive(caps=self.caps, lite=True) # type: ignore
2200
+ self.lite_core_success = True
2201
+ self.lite_core_error_msg = ""
2202
  self.lite_core_ready.set()
2203
+ print("[Bootstrap] Lite Hive Core initialized successfully.")
2204
  except Exception as e:
2205
+ self.lite_core_success = False
2206
+ self.lite_core_error_msg = f"Failed to initialize Lite Hive Core: {e}"
2207
+ print(f"[ERROR] {self.lite_core_error_msg}")
2208
+ import traceback
2209
+ traceback.print_exc()
2210
  # In case of failure, we still set the event to not hang the UI.
2211
  self.lite_core_ready.set()
2212
 
 
2233
 
2234
  # Wait for the main LLM and finalize full core
2235
  llm_thread.join()
2236
+ self.hive_instance = get_hive_instance(lite=False) # Ensure full instance is assigned
2237
  self.hive_ready.set()
2238
  logging.info("Full Hive Core is ready.")
2239