hysts HF Staff commited on
Commit
b0f6e14
·
1 Parent(s): c2954c2
Files changed (2) hide show
  1. README.md +3 -2
  2. app.py +12 -1
README.md CHANGED
@@ -1,5 +1,6 @@
1
  ---
2
- title: Base Space
 
3
  emoji: ⚡
4
  colorFrom: red
5
  colorTo: purple
@@ -7,8 +8,8 @@ sdk: gradio
7
  sdk_version: 3.44.0
8
  python_version: 3.10.12
9
  app_file: app.py
10
- license: mit
11
  duplicated_from: hysts-debug/base-space
 
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ license: mit
3
+ title: dropdown-custom-value
4
  emoji: ⚡
5
  colorFrom: red
6
  colorTo: purple
 
8
  sdk_version: 3.44.0
9
  python_version: 3.10.12
10
  app_file: app.py
 
11
  duplicated_from: hysts-debug/base-space
12
+ pinned: false
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -3,7 +3,18 @@
3
  import gradio as gr
4
 
5
  with gr.Blocks() as demo:
6
- pass
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  if __name__ == "__main__":
9
  demo.queue().launch()
 
3
  import gradio as gr
4
 
5
  with gr.Blocks() as demo:
6
+ with gr.Row():
7
+ with gr.Column():
8
+ dropdown = gr.Dropdown(
9
+ choices=["abc", "def", "ghi"],
10
+ value="abc",
11
+ allow_custom_value=True,
12
+ )
13
+ button = gr.Button()
14
+ with gr.Column():
15
+ out = gr.Textbox()
16
+
17
+ button.click(fn=lambda x: x, inputs=dropdown, outputs=out)
18
 
19
  if __name__ == "__main__":
20
  demo.queue().launch()