dawood's picture
dawood HF Staff
Create app.py
8bc1b99
raw
history blame
550 Bytes
import gradio as gr
def change_textbox(choice):
if choice == "short":
return gr.Radio.update(lines=2, visible=True)
elif choice == "long":
return gr.Radio.update(lines=8, visible=True)
else:
return gr.Radio.update(visible=False)
with gr.Blocks() as block:
radio = gr.Radio(["short", "long", "none"],
label="What kind of essay would you like to write?")
text = gr.Textbox(lines=2, interactive=True)
radio.change(fn=change_textbox, inputs=radio, outputs=text)
block.launch()