Spaces:
Sleeping
Sleeping
import gradio as gr | |
def greet(inp): | |
return "Hello " + inp + "!" | |
with gr.Blocks() as demo: | |
with gr.Row(): | |
with gr.Column(scale=2): | |
text1 = gr.Textbox(lines=7, label="Prompt", scale=2) | |
with gr.Row(): | |
btn1 = gr.Button("Submit", scale=1) | |
btn2 = gr.Button("Clear", scale=1) | |
btn3 = gr.Button("Clean Memory", scale=2) | |
with gr.Column(scale=2): | |
out_text = gr.Text(lines=15, label="Output", scale=2) | |
btn1.click(fn=greet, inputs=text1, outputs=out_text) | |
btn2.click(lambda: [None, None], outputs=[text1, out_text]) | |
demo.launch() | |