Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -122,7 +122,7 @@ def select_best_response(responses):
|
|
122 |
@app.post("/generate_chat")
|
123 |
async def generate_chat(request: ChatRequest):
|
124 |
if not request.message.strip():
|
125 |
-
raise HTTPException(status_code=400, detail="
|
126 |
|
127 |
responses = []
|
128 |
num_models = len(global_data['models'])
|
@@ -137,7 +137,7 @@ async def generate_chat(request: ChatRequest):
|
|
137 |
pass
|
138 |
|
139 |
if not responses:
|
140 |
-
raise HTTPException(status_code=500, detail="Error: No
|
141 |
|
142 |
best_response = select_best_response(responses)
|
143 |
|
|
|
122 |
@app.post("/generate_chat")
|
123 |
async def generate_chat(request: ChatRequest):
|
124 |
if not request.message.strip():
|
125 |
+
raise HTTPException(status_code=400, detail="Error: No message provided.")
|
126 |
|
127 |
responses = []
|
128 |
num_models = len(global_data['models'])
|
|
|
137 |
pass
|
138 |
|
139 |
if not responses:
|
140 |
+
raise HTTPException(status_code=500, detail="Error: No responses generated.")
|
141 |
|
142 |
best_response = select_best_response(responses)
|
143 |
|