mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-05 11:10:03 +08:00
* changes
* changes
* add changeset
* changes
* changes
* fix box changes on website
* add changeset
* changes
* changes
* Revert "changes"
This reverts commit 189b4e844a
.
* chanegs
* changes
* changes
* changes
* changes
* add changeset
* Update fancy-bats-deny.md
---------
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
24 lines
600 B
Python
24 lines
600 B
Python
import gradio as gr
|
|
|
|
|
|
def change_textbox(choice):
|
|
if choice == "short":
|
|
return gr.Textbox.update(lines=2, visible=True)
|
|
elif choice == "long":
|
|
return gr.Textbox.update(lines=8, visible=True)
|
|
else:
|
|
return gr.Textbox.update(visible=False)
|
|
|
|
|
|
with gr.Blocks() as demo:
|
|
radio = gr.Radio(
|
|
["short", "long", "none"], label="What kind of essay would you like to write?"
|
|
)
|
|
text = gr.Textbox(lines=2, interactive=True, show_copy_button=True)
|
|
|
|
radio.change(fn=change_textbox, inputs=radio, outputs=text)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|