Update app.py
Browse files
app.py
CHANGED
@@ -65,30 +65,22 @@ def respond(message, history):
|
|
65 |
return f"An error occurred: {e}", history
|
66 |
|
67 |
# UI Setup
|
68 |
-
with gr.Blocks(theme=gr.themes.Soft(font=[gr.themes.GoogleFont("Roboto Mono")])
|
69 |
-
gr.Markdown("#
|
70 |
-
|
71 |
-
with gr.Tabs():
|
72 |
-
with gr.TabItem("Intro"):
|
73 |
-
gr.Markdown("## Welcome to DocBot! 📄🤖\nAsk questions related to the uploaded document.")
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
chatbot = gr.Chatbot(height=500)
|
82 |
-
user_message = gr.Textbox(placeholder="Step-1: Ask me questions about the uploaded document!", container=False)
|
83 |
-
submit_btn = gr.Button("Send")
|
84 |
-
clear_btn = gr.Button("Clear Chat")
|
85 |
-
|
86 |
-
# `respond` fonksiyonu, kullanıcı sorularını cevaplamak için kullanılacak
|
87 |
-
submit_btn.click(fn=respond, inputs=[user_message, chatbot], outputs=[chatbot, user_message])
|
88 |
|
89 |
-
|
90 |
-
|
91 |
|
92 |
# Launch the demo
|
93 |
if __name__ == "__main__":
|
94 |
-
demo.launch()
|
|
|
65 |
return f"An error occurred: {e}", history
|
66 |
|
67 |
# UI Setup
|
68 |
+
with gr.Blocks(theme=gr.themes.Soft(font=[gr.themes.GoogleFont("Roboto Mono")])) as demo:
|
69 |
+
gr.Markdown("# HundAI Chatbot🤖")
|
|
|
|
|
|
|
|
|
70 |
|
71 |
+
with gr.Row():
|
72 |
+
with gr.Column(scale=3):
|
73 |
+
chatbot = gr.Chatbot(height=500)
|
74 |
+
user_message = gr.Textbox(placeholder="Ask me questions anything about the Hund Ecosystem!", container=False)
|
75 |
+
submit_btn = gr.Button("Ask")
|
76 |
+
clear_btn = gr.Button("Clear Chat")
|
77 |
|
78 |
+
# `respond` fonksiyonu, kullanıcı sorularını cevaplamak için kullanılacak
|
79 |
+
submit_btn.click(fn=respond, inputs=[user_message, chatbot], outputs=[chatbot, user_message])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
+
# `clear` butonu, sohbeti temizleyecek
|
82 |
+
clear_btn.click(lambda: [None, []], outputs=[chatbot, chatbot])
|
83 |
|
84 |
# Launch the demo
|
85 |
if __name__ == "__main__":
|
86 |
+
demo.launch()
|