MissieMcCown commited on
Commit
cbb60b6
·
verified ·
1 Parent(s): 4c522a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -16
app.py CHANGED
@@ -1,24 +1,17 @@
1
  import gradio as gr
2
 
3
- # Enhanced chatbot response function
4
- def chatbot_response(user_input):
5
- if 'time management' in user_input.lower():
6
- return "Time management is important! Here are a few tips: 1. Prioritize tasks. 2. Set deadlines. 3. Break tasks into smaller parts."
7
- elif 'science' in user_input.lower():
8
- return "Science is fascinating! What specific topic are you interested in? Physics, Chemistry, Biology?"
9
- else:
10
- return f"You said: {user_input}"
11
 
12
- # Gradio interface setup
13
  with gr.Blocks() as demo:
14
- gr.Markdown("### Study Assistance Chatbot")
15
- user_input = gr.Textbox(label="Enter your question here:", placeholder="Type your question...")
16
- chatbot_output = gr.Textbox(label="Chatbot Response")
17
- submit_button = gr.Button("Submit")
18
-
19
- submit_button.click(chatbot_response, inputs=user_input, outputs=chatbot_output)
20
 
21
- # Launch Gradio
 
 
 
22
  demo.launch()
23
 
24
 
 
1
  import gradio as gr
2
 
3
+ def check_gradio():
4
+ return "Gradio is installed!"
 
 
 
 
 
 
5
 
6
+ # Create a simple interface to test Gradio
7
  with gr.Blocks() as demo:
8
+ gr.Markdown("### Gradio Installation Check")
9
+ output_text = gr.Textbox()
 
 
 
 
10
 
11
+ check_button = gr.Button("Check Gradio")
12
+ check_button.click(check_gradio, outputs=output_text)
13
+
14
+ # Launch Gradio interface
15
  demo.launch()
16
 
17