Uhhy commited on
Commit
e9fd885
1 Parent(s): 43c97db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -49,7 +49,7 @@ class ModelManager:
49
  return self.models
50
 
51
  print("Iniciando carga de modelos...")
52
- with ThreadPoolExecutor(max_workers=len(model_configs)) as executor:
53
  futures = [executor.submit(self.load_model, config) for config in model_configs]
54
  models = []
55
  for future in tqdm(as_completed(futures), total=len(model_configs), desc="Cargando modelos", unit="modelo"):
@@ -156,7 +156,7 @@ async def generate_chat(request: ChatRequest):
156
  responses = []
157
  num_models = len(global_data['models'])
158
 
159
- with ThreadPoolExecutor(max_workers=num_models) as executor:
160
  futures = [executor.submit(worker_function, model_data, request) for model_data in global_data['models']]
161
  for future in tqdm(as_completed(futures), total=num_models, desc="Generando respuestas", unit="modelo"):
162
  try:
 
49
  return self.models
50
 
51
  print("Iniciando carga de modelos...")
52
+ with ThreadPoolExecutor() as executor: # No hay límite de trabajadores
53
  futures = [executor.submit(self.load_model, config) for config in model_configs]
54
  models = []
55
  for future in tqdm(as_completed(futures), total=len(model_configs), desc="Cargando modelos", unit="modelo"):
 
156
  responses = []
157
  num_models = len(global_data['models'])
158
 
159
+ with ThreadPoolExecutor() as executor: # No se establece límite de concurrencia
160
  futures = [executor.submit(worker_function, model_data, request) for model_data in global_data['models']]
161
  for future in tqdm(as_completed(futures), total=num_models, desc="Generando respuestas", unit="modelo"):
162
  try: