mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
5436031f92
* changes * add changeset * changes * changes * changes * changes * changes * changes * changeas * changes * add changeset * changes * add changeset * changes * changes * changes * changes * changes * changes * changes * changes * add changeset * changes * cganges * changes * changes * changes * changes * add changeset * changes * chagnes * changes * changes * changes * changes * remove console log * changes * changes * changes * changes * changes --------- Co-authored-by: Ali Abid <aliabid94@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
19 lines
558 B
Python
19 lines
558 B
Python
import gradio as gr
|
|
|
|
with gr.Blocks() as demo:
|
|
input_text = gr.Textbox(label="input")
|
|
mode = gr.Radio(["textbox", "button"], value="textbox")
|
|
|
|
@gr.render(inputs=[input_text, mode], triggers=[input_text.submit])
|
|
def show_split(text, mode):
|
|
if len(text) == 0:
|
|
gr.Markdown("## No Input Provided")
|
|
else:
|
|
for letter in text:
|
|
if mode == "textbox":
|
|
gr.Textbox(letter)
|
|
else:
|
|
gr.Button(letter)
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch() |