gradio_test / app.py
mohammad2928git's picture
Update app.py
4cf53d1 verified
raw
history blame
639 Bytes
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()