Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -57,8 +57,7 @@ def chat(message, history, model):
|
|
| 57 |
history = history or []
|
| 58 |
prefix = {"Agni": "π₯ ", "Vayu": "π ", "Akash": "π "}.get(model, "π₯ ")
|
| 59 |
response = get_response(message)
|
| 60 |
-
history.append(
|
| 61 |
-
history.append({"role": "assistant", "content": prefix + response})
|
| 62 |
return history, ""
|
| 63 |
|
| 64 |
with gr.Blocks(title="Devrayog AI") as demo:
|
|
@@ -68,7 +67,7 @@ with gr.Blocks(title="Devrayog AI") as demo:
|
|
| 68 |
with gr.Row():
|
| 69 |
with gr.Column(scale=3):
|
| 70 |
model = gr.Radio(["Agni", "Vayu", "Akash"], value="Agni", label="Model")
|
| 71 |
-
chatbot = gr.Chatbot(height=350, show_label=False
|
| 72 |
with gr.Row():
|
| 73 |
msg = gr.Textbox(placeholder="Ask about SSB, NDA, TAT...", scale=4, container=False, autofocus=True)
|
| 74 |
send = gr.Button("Send", scale=1, variant="primary")
|
|
|
|
| 57 |
history = history or []
|
| 58 |
prefix = {"Agni": "π₯ ", "Vayu": "π ", "Akash": "π "}.get(model, "π₯ ")
|
| 59 |
response = get_response(message)
|
| 60 |
+
history.append((message, prefix + response))
|
|
|
|
| 61 |
return history, ""
|
| 62 |
|
| 63 |
with gr.Blocks(title="Devrayog AI") as demo:
|
|
|
|
| 67 |
with gr.Row():
|
| 68 |
with gr.Column(scale=3):
|
| 69 |
model = gr.Radio(["Agni", "Vayu", "Akash"], value="Agni", label="Model")
|
| 70 |
+
chatbot = gr.Chatbot(height=350, show_label=False)
|
| 71 |
with gr.Row():
|
| 72 |
msg = gr.Textbox(placeholder="Ask about SSB, NDA, TAT...", scale=4, container=False, autofocus=True)
|
| 73 |
send = gr.Button("Send", scale=1, variant="primary")
|