aidevhund commited on
Commit
0235a21
·
verified ·
1 Parent(s): 7b8bd19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -21
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")]), css='footer {visibility: hidden}') as demo:
69
- gr.Markdown("# DocBot📄🤖")
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
- with gr.TabItem("DocBot"):
76
- with gr.Accordion("=== IMPORTANT: READ ME FIRST ===", open=False):
77
- gr.Markdown("## Please ask questions about the uploaded document.\nYou can interact with the document once it's loaded.")
 
 
 
78
 
79
- with gr.Row():
80
- with gr.Column(scale=3):
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
- # `clear` butonu, sohbeti temizleyecek
90
- clear_btn.click(lambda: [None, []], outputs=[chatbot, chatbot])
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()