MissieMcCown commited on
Commit
2ab4929
·
verified ·
1 Parent(s): 2f27609

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -16
app.py CHANGED
@@ -1,25 +1,14 @@
1
  import gradio as gr
2
 
3
  def chatbot_response(user_input):
 
4
  if user_input.lower() in ["hello", "hi"]:
5
- return "Hello! How can I help you with your studies today?"
6
- elif "supervised learning" in user_input.lower():
7
- return "Supervised learning is a machine learning approach where models are trained using labeled data."
8
- else:
9
- return "I'm here to assist you with your academic questions. Please ask me anything!"
10
-
11
- # Gradio Interface
12
- with gr.Blocks() as demo:
13
- gr.Markdown("### Study Assistance Chatbot")
14
- gr.Markdown("Welcome! Ask me anything related to your academic studies.")
15
 
16
- user_input = gr.Textbox(label="Enter your question here:")
17
- chatbot_output = gr.Textbox(label="Chatbot Response")
18
- submit_button = gr.Button("Submit")
19
-
20
- submit_button.click(chatbot_response, inputs=user_input, outputs=chatbot_output)
21
 
22
- demo.launch(share=True) # Make the app public if you want others to access
23
 
24
 
25
 
 
1
  import gradio as gr
2
 
3
  def chatbot_response(user_input):
4
+ # Handle basic greeting
5
  if user_input.lower() in ["hello", "hi"]:
6
+ return "Hello! How can I assist you today?"
 
 
 
 
 
 
 
 
 
7
 
8
+ # Add more conditions for different queries here
9
+ elif "supervised learning" in user_input.lower():
10
+ return "Supervised learning is a machine learning approach
 
 
11
 
 
12
 
13
 
14