Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,9 +47,8 @@ def solve(question, class_level, history):
|
|
| 47 |
answer = reply.split("<|im_start|>assistant\n")[-1]
|
| 48 |
answer = answer.replace("<|im_end|>", "").strip()
|
| 49 |
|
| 50 |
-
# ✅
|
| 51 |
-
history.append(
|
| 52 |
-
history.append({"role": "assistant", "content": answer})
|
| 53 |
return history, ""
|
| 54 |
|
| 55 |
with gr.Blocks(title="Math Tutor Class 6-10") as app:
|
|
@@ -60,8 +59,7 @@ with gr.Blocks(title="Math Tutor Class 6-10") as app:
|
|
| 60 |
choices=["6", "7", "8", "9", "10"],
|
| 61 |
value="8", label="Select Class", scale=1
|
| 62 |
)
|
| 63 |
-
|
| 64 |
-
chatbot = gr.Chatbot(label="Math Solutions", height=450, type="messages")
|
| 65 |
with gr.Row():
|
| 66 |
question = gr.Textbox(
|
| 67 |
label="Your Question",
|
|
|
|
| 47 |
answer = reply.split("<|im_start|>assistant\n")[-1]
|
| 48 |
answer = answer.replace("<|im_end|>", "").strip()
|
| 49 |
|
| 50 |
+
# ✅ Simple tuple format — works across all Gradio versions
|
| 51 |
+
history.append((question, answer))
|
|
|
|
| 52 |
return history, ""
|
| 53 |
|
| 54 |
with gr.Blocks(title="Math Tutor Class 6-10") as app:
|
|
|
|
| 59 |
choices=["6", "7", "8", "9", "10"],
|
| 60 |
value="8", label="Select Class", scale=1
|
| 61 |
)
|
| 62 |
+
chatbot = gr.Chatbot(label="Math Solutions", height=450)
|
|
|
|
| 63 |
with gr.Row():
|
| 64 |
question = gr.Textbox(
|
| 65 |
label="Your Question",
|