Uhhy commited on
Commit
98b623b
1 Parent(s): 4f21ff8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -46,7 +46,6 @@ model_configs = [
46
 
47
  class ModelManager:
48
  def __init__(self):
49
- self.loaded = False
50
  self.models = {}
51
 
52
  def load_model(self, model_config):
@@ -57,12 +56,9 @@ class ModelManager:
57
  print(f"Error loading model {model_config['name']}: {e}")
58
 
59
  def load_all_models(self):
60
- if not self.loaded:
61
- with ThreadPoolExecutor() as executor:
62
- for config in model_configs:
63
- executor.submit(self.load_model, config)
64
- self.loaded = True
65
-
66
  return self.models
67
 
68
  model_manager = ModelManager()
 
46
 
47
  class ModelManager:
48
  def __init__(self):
 
49
  self.models = {}
50
 
51
  def load_model(self, model_config):
 
56
  print(f"Error loading model {model_config['name']}: {e}")
57
 
58
  def load_all_models(self):
59
+ with ThreadPoolExecutor() as executor:
60
+ for config in model_configs:
61
+ executor.submit(self.load_model, config)
 
 
 
62
  return self.models
63
 
64
  model_manager = ModelManager()