Spaces:
Sleeping
Sleeping
added better formatting
Browse files
app.py
CHANGED
|
@@ -63,10 +63,15 @@ Context:
|
|
| 63 |
):
|
| 64 |
token = message.choices[0].delta.content
|
| 65 |
response["content"] += token
|
| 66 |
-
|
|
|
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
if __name__ == "__main__":
|
| 72 |
demo.launch()
|
|
|
|
| 63 |
):
|
| 64 |
token = message.choices[0].delta.content
|
| 65 |
response["content"] += token
|
| 66 |
+
formatted = response["content"].replace("\n", "\n\n")
|
| 67 |
+
yield {"role": "assistant", "content": formatted}
|
| 68 |
|
| 69 |
+
demo = gr.ChatInterface(
|
| 70 |
+
respond, type="messages",
|
| 71 |
+
chatbot=gr.Chatbot(render_markdown=True),
|
| 72 |
+
title="Tariff Code RAG Bot",
|
| 73 |
+
description="Ask questions about tariff codes using natural language."
|
| 74 |
+
)
|
| 75 |
|
| 76 |
if __name__ == "__main__":
|
| 77 |
demo.launch()
|