Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
| 110 |
name = gr.Textbox(label="Name", placeholder="Enter your name")
|
| 111 |
-
|
| 112 |
-
submit_btn = gr.Button("Submit")
|
| 113 |
-
survey_output = gr.Textbox(label="Survey Response")
|
| 114 |
|
| 115 |
-
|
|
|
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
gr.Markdown("## Chatbot")
|
| 118 |
-
|
| 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()
|