Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -107,6 +107,7 @@ async def process_message(message):
|
|
107 |
return response_cache[inputs]
|
108 |
|
109 |
responses = {}
|
|
|
110 |
with ThreadPoolExecutor(max_workers=len(global_data['model_configs'])) as executor:
|
111 |
futures = [executor.submit(generate_model_response, model_manager.get_model(config['name']), inputs) for config in global_data['model_configs'] if model_manager.get_model(config['name'])]
|
112 |
for i, future in enumerate(tqdm(as_completed(futures), total=len([f for f in futures]), desc="Generating responses")):
|
@@ -131,6 +132,7 @@ async def api_generate_multimodel(request: Request):
|
|
131 |
except Exception as e:
|
132 |
return JSONResponse({"error": str(e)}, status_code=500)
|
133 |
|
|
|
134 |
iface = gr.Interface(
|
135 |
fn=process_message,
|
136 |
inputs=gr.Textbox(lines=2, placeholder="Enter your message here..."),
|
|
|
107 |
return response_cache[inputs]
|
108 |
|
109 |
responses = {}
|
110 |
+
|
111 |
with ThreadPoolExecutor(max_workers=len(global_data['model_configs'])) as executor:
|
112 |
futures = [executor.submit(generate_model_response, model_manager.get_model(config['name']), inputs) for config in global_data['model_configs'] if model_manager.get_model(config['name'])]
|
113 |
for i, future in enumerate(tqdm(as_completed(futures), total=len([f for f in futures]), desc="Generating responses")):
|
|
|
132 |
except Exception as e:
|
133 |
return JSONResponse({"error": str(e)}, status_code=500)
|
134 |
|
135 |
+
|
136 |
iface = gr.Interface(
|
137 |
fn=process_message,
|
138 |
inputs=gr.Textbox(lines=2, placeholder="Enter your message here..."),
|