Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 + [
|
| 24 |
if len(selected_models) > 5:
|
| 25 |
-
return history + [
|
| 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 + [
|
| 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!")
|