Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 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 |
-
#
|
| 13 |
with gr.Blocks() as demo:
|
| 14 |
-
gr.Markdown("###
|
| 15 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
|