Spaces:
Sleeping
Sleeping
Update app.py
Browse files123456789101112131415161718import gradio as grdef check_gradio():return "Gradio is installed!"# Create a simple interface to test Gradiowith gr.Blocks() as demo:gr.Markdown("### Gradio Installation Check")output_text = gr.Textbox()check_button = gr.Button("Check Gradio")check_button.click(check_gradio, outputs=output_text)# Launch Gradio interfacedemo.launch()1234567891011121314151617181920212223242526import gradio as grdef chatbot_response(user_input):if user_input.lower() in ["hello", "hi"]:return "Hello! How can I help you with your studies today?"elif "supervised learning" in user_input.lower():return "Supervised learning is a machine learning approach where models are trained using labeled data."else:return "I'm here to assist you with your academic questions. Please ask me anything!"# Gradio Interfacewith gr.Blocks() as demo:gr.Markdown("### Study Assistance Chatbot")gr.Markdown("Welcome! Ask me anything related to your academic studies.")user_input = gr.Textbox(label="Enter your question here:")chatbot_output = gr.Textbox(label="Chatbot Response")submit_button = gr.Button("Submit")submit_button.click(chatbot_response, inputs=user_input, outputs=chatbot_output)demo.launch(share=True) # Make the app public if you want others to access
app.py+17-9