yetessam commited on
Commit
2776f22
·
verified ·
1 Parent(s): 2945906

Update ContentGradio.py

Browse files
Files changed (1) hide show
  1. ContentGradio.py +4 -4
ContentGradio.py CHANGED
@@ -31,10 +31,10 @@ def create_main():
31
  def create_examples(output):
32
  with gr.Row():
33
  gr.Markdown("<div id='examples'>Try one of these examples:</div>")
34
- example_1 = gr.Button("Example 1: Hello World")
35
- example_2 = gr.Button("Example 2: How are you?")
36
- example_1.click(get_example, inputs="Example 1", outputs=output)
37
- example_2.click(get_example, inputs="Example 2", outputs=output)
38
 
39
  # Create the footer section
40
  def create_footer():
 
31
  def create_examples(output):
32
  with gr.Row():
33
  gr.Markdown("<div id='examples'>Try one of these examples:</div>")
34
+ example_radio = gr.Radio(choices=examples, label="Select an Example")
35
+
36
+ # When an example is selected, populate the input field
37
+ example_radio.change(fn=lambda example: example, inputs=example_radio, outputs=user_input)
38
 
39
  # Create the footer section
40
  def create_footer():