Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def chat(message, history):
|
|
| 32 |
for h in history:
|
| 33 |
if isinstance(h, dict):
|
| 34 |
messages.append(h)
|
| 35 |
-
|
| 36 |
messages.append({"role": "user", "content": h[0]})
|
| 37 |
messages.append({"role": "assistant", "content": h[1]})
|
| 38 |
messages.append({"role": "user", "content": message})
|
|
@@ -53,7 +53,6 @@ def chat(message, history):
|
|
| 53 |
|
| 54 |
demo = gr.ChatInterface(
|
| 55 |
fn=chat,
|
| 56 |
-
type="messages",
|
| 57 |
title="MathBio AI — Mathematical Biology Assistant",
|
| 58 |
description="A specialized LLM for mathematical biology, epidemic modeling, PDEs, and operator learning. Fine-tuned on 27K arxiv-derived examples.",
|
| 59 |
examples=[
|
|
|
|
| 32 |
for h in history:
|
| 33 |
if isinstance(h, dict):
|
| 34 |
messages.append(h)
|
| 35 |
+
elif isinstance(h, (list, tuple)) and len(h) == 2:
|
| 36 |
messages.append({"role": "user", "content": h[0]})
|
| 37 |
messages.append({"role": "assistant", "content": h[1]})
|
| 38 |
messages.append({"role": "user", "content": message})
|
|
|
|
| 53 |
|
| 54 |
demo = gr.ChatInterface(
|
| 55 |
fn=chat,
|
|
|
|
| 56 |
title="MathBio AI — Mathematical Biology Assistant",
|
| 57 |
description="A specialized LLM for mathematical biology, epidemic modeling, PDEs, and operator learning. Fine-tuned on 27K arxiv-derived examples.",
|
| 58 |
examples=[
|