pragyarama commited on
Commit
50048e2
·
verified ·
1 Parent(s): b5c0587

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -106,16 +106,22 @@ def submit_survey(name, gender):
106
  with gr.Blocks() as demo:
107
  gr.Markdown("## Survey")
108
 
109
- with gr.Row():
110
  name = gr.Textbox(label="Name", placeholder="Enter your name")
111
- gender = gr.Textbox(label="Gender", placeholder="Enter your gender")
112
- submit_btn = gr.Button("Submit")
113
- survey_output = gr.Textbox(label="Survey Response")
114
 
115
- submit_btn.click(submit_survey, inputs=[name, gender], outputs=survey_output)
 
116
 
 
 
 
 
 
 
 
117
  gr.Markdown("## Chatbot")
118
- chat_interface = gr.ChatInterface(respond, type="messages")
119
 
120
 
121
  demo.launch()
 
106
  with gr.Blocks() as demo:
107
  gr.Markdown("## Survey")
108
 
109
+ with gr.Column():
110
  name = gr.Textbox(label="Name", placeholder="Enter your name")
111
+ country = gr.Dropdown(label="Country", choices=["Italy", "Japan", "Brazil"])
 
 
112
 
113
+ submit_btn = gr.Button("Submit Survey")
114
+ survey_output = gr.Textbox(label="Response", interactive=False)
115
 
116
+ submit_btn.click(
117
+ fn=lambda name, country: f"{name} and {country}",
118
+ inputs=[name, country],
119
+ outputs=survey_output
120
+ )
121
+
122
+ gr.Markdown("---")
123
  gr.Markdown("## Chatbot")
124
+ gr.ChatInterface(respond)
125
 
126
 
127
  demo.launch()