Manasa1 commited on
Commit
1587b05
·
verified ·
1 Parent(s): dbd2a4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -65,15 +65,14 @@ def chatbot_response(query):
65
  except Exception as e:
66
  return f"An error occurred: {str(e)}"
67
 
68
- iface = gr.Interface(
69
- fn=chatbot_response,
70
- inputs=gr.Textbox(lines=2, placeholder="Enter your question..."),
71
- outputs="text",
72
- title="Medical Chatbot",
73
- description="Ask a medical question and get answers based on the provided context.",
74
- live=True
75
- )
76
 
77
- iface.launch()
78
 
79
 
 
65
  except Exception as e:
66
  return f"An error occurred: {str(e)}"
67
 
68
+ with gr.Blocks() as demo:
69
+ chatbot = gr.Chatbot()
70
+ with gr.Row():
71
+ msg = gr.Textbox(show_label=False, placeholder="Enter your question...")
72
+ submit = gr.Button("Send")
73
+ submit.click(chatbot_response, [msg, chatbot], [chatbot, chatbot])
74
+ msg.submit(chatbot_response, [msg, chatbot], [chatbot, chatbot])
 
75
 
76
+ demo.launch()
77
 
78