Bachstelze commited on
Commit
06a04e7
·
1 Parent(s): 211c86b

delete unused global variable

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -253,7 +253,6 @@ def load_classification_example():
253
 
254
 
255
  def create_interface():
256
- global models_loaded
257
 
258
  if FEATURE_NAMES is None:
259
  error_message = loading_error if loading_error else "Model not loaded"
@@ -446,6 +445,7 @@ def create_interface():
446
  return demo
447
 
448
  def load_models_async():
 
449
  global models_loaded
450
  start_time = time.perf_counter()
451
  print("Starting asynchronous model loading...")
@@ -456,8 +456,6 @@ def load_models_async():
456
  print(f"Model loading complete (total time: {elapsed_time:.2f} seconds)")
457
 
458
  if __name__ == "__main__":
459
- # Load models asynchronously in background threads
460
- models_loaded = False
461
  # Start model loading in background thread
462
  loading_thread = threading.Thread(target=load_models_async, daemon=True)
463
  loading_thread.start()
 
253
 
254
 
255
  def create_interface():
 
256
 
257
  if FEATURE_NAMES is None:
258
  error_message = loading_error if loading_error else "Model not loaded"
 
445
  return demo
446
 
447
  def load_models_async():
448
+ # Load models asynchronously in background threads
449
  global models_loaded
450
  start_time = time.perf_counter()
451
  print("Starting asynchronous model loading...")
 
456
  print(f"Model loading complete (total time: {elapsed_time:.2f} seconds)")
457
 
458
  if __name__ == "__main__":
 
 
459
  # Start model loading in background thread
460
  loading_thread = threading.Thread(target=load_models_async, daemon=True)
461
  loading_thread.start()