Spaces:
Sleeping
Sleeping
Update ContentGradio.py
Browse files- ContentGradio.py +5 -5
ContentGradio.py
CHANGED
|
@@ -40,8 +40,9 @@ def create_main():
|
|
| 40 |
with gr.Row():
|
| 41 |
with gr.Column():
|
| 42 |
user_input = gr.Textbox(label="Your Input", placeholder="Enter something here...")
|
| 43 |
-
output = gr.Textbox(label="Output", interactive=False)
|
| 44 |
user_input.submit(process_input, inputs=user_input, outputs=output)
|
|
|
|
|
|
|
| 45 |
return user_input, output # Return both input and output components
|
| 46 |
|
| 47 |
# Create the examples section
|
|
@@ -49,10 +50,9 @@ def create_examples(user_input):
|
|
| 49 |
# Fetch examples by calling get_example() here
|
| 50 |
examples = get_example()
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
example_radio = gr.Radio(choices=examples, label="Select an Example")
|
| 56 |
|
| 57 |
# When an example is selected, populate the input field
|
| 58 |
example_radio.change(fn=lambda example: example, inputs=example_radio, outputs=user_input)
|
|
|
|
| 40 |
with gr.Row():
|
| 41 |
with gr.Column():
|
| 42 |
user_input = gr.Textbox(label="Your Input", placeholder="Enter something here...")
|
|
|
|
| 43 |
user_input.submit(process_input, inputs=user_input, outputs=output)
|
| 44 |
+
output = gr.Textbox(label="Output", interactive=False)
|
| 45 |
+
|
| 46 |
return user_input, output # Return both input and output components
|
| 47 |
|
| 48 |
# Create the examples section
|
|
|
|
| 50 |
# Fetch examples by calling get_example() here
|
| 51 |
examples = get_example()
|
| 52 |
|
| 53 |
+
gr.Markdown("<div id='examples'>Try one of these examples:</div>")
|
| 54 |
+
# Create a Radio component with the list of examples
|
| 55 |
+
example_radio = gr.Radio(choices=examples, label="Select an Example")
|
|
|
|
| 56 |
|
| 57 |
# When an example is selected, populate the input field
|
| 58 |
example_radio.change(fn=lambda example: example, inputs=example_radio, outputs=user_input)
|