anktechsol commited on
Commit
0d9116e
·
verified ·
1 Parent(s): aae51bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,9 +20,9 @@ AVAILABLE_MODELS = [
20
 
21
  def chat(message, history, selected_models):
22
  if not selected_models:
23
- return history + [[message, "⚠️ Select at least one model!"]]
24
  if len(selected_models) > 5:
25
- return history + [[message, "⚠️ Maximum 5 models!"]]
26
 
27
  responses = []
28
  for model in selected_models:
@@ -44,7 +44,7 @@ def chat(message, history, selected_models):
44
  else:
45
  responses.append(f"**{model}:**\n❌ {error[:100]}\n")
46
 
47
- return history + [[message, "\n---\n\n".join(responses)]]
48
 
49
  with gr.Blocks(title="Anki-Chat", theme=gr.themes.Soft()) as demo:
50
  gr.Markdown("# 🤖 Anki-Chat\nChat with top models: Llama, Qwen, DeepSeek, Mistral, Gemma & more!")
 
20
 
21
  def chat(message, history, selected_models):
22
  if not selected_models:
23
+ return history + [{"role": "user", "content": message}, {"role": "assistant", "content": "⚠️ Select at least one model!"}]
24
  if len(selected_models) > 5:
25
+ return history + [{"role": "user", "content": message}, {"role": "assistant", "content": "⚠️ Maximum 5 models!"}]
26
 
27
  responses = []
28
  for model in selected_models:
 
44
  else:
45
  responses.append(f"**{model}:**\n❌ {error[:100]}\n")
46
 
47
+ return history + [{"role": "user", "content": message}, {"role": "assistant", "content": "\n---\n\n".join(responses)}]
48
 
49
  with gr.Blocks(title="Anki-Chat", theme=gr.themes.Soft()) as demo:
50
  gr.Markdown("# 🤖 Anki-Chat\nChat with top models: Llama, Qwen, DeepSeek, Mistral, Gemma & more!")