Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -619,7 +619,7 @@ def chat_with_groq(message, history):
|
|
| 619 |
return f"Error: {str(e)}"
|
| 620 |
|
| 621 |
# ββ Gradio UI βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 622 |
-
with gr.Blocks(title="CKD-MultiVision"
|
| 623 |
gr.Markdown("""
|
| 624 |
# CKD-MultiVision
|
| 625 |
### Multimodal AI System for Early Chronic Kidney Disease Detection
|
|
@@ -708,7 +708,7 @@ with gr.Blocks(title="CKD-MultiVision", theme=gr.themes.Soft()) as demo:
|
|
| 708 |
# ββ Tab 2: CKD Health Coach ββββββββββββββββββββββββββββββββββββββββ
|
| 709 |
with gr.TabItem(" CKD Health Coach"):
|
| 710 |
gr.Markdown("### Ask about diet, lifestyle, exercise, and kidney health.")
|
| 711 |
-
chatbot = gr.Chatbot(height=450
|
| 712 |
chat_input = gr.Textbox(placeholder="Ask a question about CKD...", label="Your Message")
|
| 713 |
send_btn = gr.Button("Send", variant="primary")
|
| 714 |
gr.Examples(
|
|
@@ -793,12 +793,12 @@ with gr.Blocks(title="CKD-MultiVision", theme=gr.themes.Soft()) as demo:
|
|
| 793 |
if not message.strip():
|
| 794 |
return history, ""
|
| 795 |
bot_response = chat_with_groq(message, history)
|
| 796 |
-
history
|
| 797 |
-
history.append(
|
| 798 |
return history, ""
|
| 799 |
|
| 800 |
send_btn.click(fn=respond, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 801 |
chat_input.submit(fn=respond, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 802 |
|
| 803 |
if __name__ == "__main__":
|
| 804 |
-
demo.launch()
|
|
|
|
| 619 |
return f"Error: {str(e)}"
|
| 620 |
|
| 621 |
# ββ Gradio UI βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 622 |
+
with gr.Blocks(title="CKD-MultiVision") as demo:
|
| 623 |
gr.Markdown("""
|
| 624 |
# CKD-MultiVision
|
| 625 |
### Multimodal AI System for Early Chronic Kidney Disease Detection
|
|
|
|
| 708 |
# ββ Tab 2: CKD Health Coach ββββββββββββββββββββββββββββββββββββββββ
|
| 709 |
with gr.TabItem(" CKD Health Coach"):
|
| 710 |
gr.Markdown("### Ask about diet, lifestyle, exercise, and kidney health.")
|
| 711 |
+
chatbot = gr.Chatbot(height=450)
|
| 712 |
chat_input = gr.Textbox(placeholder="Ask a question about CKD...", label="Your Message")
|
| 713 |
send_btn = gr.Button("Send", variant="primary")
|
| 714 |
gr.Examples(
|
|
|
|
| 793 |
if not message.strip():
|
| 794 |
return history, ""
|
| 795 |
bot_response = chat_with_groq(message, history)
|
| 796 |
+
history = history or []
|
| 797 |
+
history.append((message, bot_response))
|
| 798 |
return history, ""
|
| 799 |
|
| 800 |
send_btn.click(fn=respond, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 801 |
chat_input.submit(fn=respond, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 802 |
|
| 803 |
if __name__ == "__main__":
|
| 804 |
+
demo.launch(theme=gr.themes.Soft())
|