Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
61 |
-
|
62 |
-
|
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()
|