Srikumar26 commited on
Commit
43b8920
·
1 Parent(s): acafd81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -1,21 +1,14 @@
1
  import gradio as gr
2
 
3
- def welcome(name):
4
- return f"Welcome to Gradio, {name}!"
5
 
6
  with gr.Blocks() as demo:
7
  gr.Markdown(
8
- """
9
- # Hello World!
10
- Start typing below to see the output.
11
- """)
12
- #inp = gr.Textbox(placeholder="What is your name?")
13
  inp = gr.Dropdown(label="Taxonomic Heirarchy", choices=["Alex", "Bert"])
14
  out = gr.Dropdown(label="Name", interactive=True)
15
- out.update(choices=["1", "2"])
16
- out3 = gr.Textbox()
17
- #out = gr.Textbox()
18
- inp.change(lambda val: out.update(choices=[str(val)+"_1", str(val)+"_2"]))
19
 
20
 
21
  demo.launch()
 
1
  import gradio as gr
2
 
3
+ def update_fn(val):
4
+ return gr.Dropdown(label="Name", choices=[str(val)+"_1", str(val)+"_2"], interactive=True)
5
 
6
  with gr.Blocks() as demo:
7
  gr.Markdown(
 
 
 
 
 
8
  inp = gr.Dropdown(label="Taxonomic Heirarchy", choices=["Alex", "Bert"])
9
  out = gr.Dropdown(label="Name", interactive=True)
10
+ inp.change(update_fn, inp, out)
11
+ )
 
 
12
 
13
 
14
  demo.launch()