Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -203,7 +203,7 @@ def battle_arena(prompt):
|
|
203 |
response_a, response_b, model_a, model_b = generate_responses(prompt)
|
204 |
|
205 |
# Check for API errors in responses
|
206 |
-
if any("Error: Unable to get response from the model" in msg["content"]
|
207 |
for msg in response_a + response_b
|
208 |
if msg["role"] == "assistant"):
|
209 |
return (
|
@@ -394,14 +394,13 @@ def continue_conversation(prompt, left_chat, right_chat, left_model, right_model
|
|
394 |
if not prompt or prompt == previous_prompt:
|
395 |
prompt = random.choice(config.example_prompts)
|
396 |
|
|
|
397 |
left_response = call_ollama_api(left_model, prompt)
|
398 |
right_response = call_ollama_api(right_model, prompt)
|
399 |
|
400 |
-
|
401 |
-
left_chat.
|
402 |
-
|
403 |
-
right_chat.append({"role": "user", "content": prompt})
|
404 |
-
right_chat.append({"role": "assistant", "content": right_response})
|
405 |
|
406 |
tie_count += 1
|
407 |
tie_button_state = gr.update(interactive=True) if tie_count < 3 else gr.update(interactive=False, value="Max ties reached. Please vote!")
|
|
|
203 |
response_a, response_b, model_a, model_b = generate_responses(prompt)
|
204 |
|
205 |
# Check for API errors in responses
|
206 |
+
if any("Error: Unable to get response from the model" in msg["content"]
|
207 |
for msg in response_a + response_b
|
208 |
if msg["role"] == "assistant"):
|
209 |
return (
|
|
|
394 |
if not prompt or prompt == previous_prompt:
|
395 |
prompt = random.choice(config.example_prompts)
|
396 |
|
397 |
+
# Get responses (which are lists of messages)
|
398 |
left_response = call_ollama_api(left_model, prompt)
|
399 |
right_response = call_ollama_api(right_model, prompt)
|
400 |
|
401 |
+
# Append messages from the response lists
|
402 |
+
left_chat.extend(left_response)
|
403 |
+
right_chat.extend(right_response)
|
|
|
|
|
404 |
|
405 |
tie_count += 1
|
406 |
tie_button_state = gr.update(interactive=True) if tie_count < 3 else gr.update(interactive=False, value="Max ties reached. Please vote!")
|