How can I remove "clear" button in Gradio Interface?

Hi, I want to remove the β€œclear” button in Gradio Interface.
Is there a way to do such a thing?

You may use Gradio blocks instead of Interface.

import gradio as gr
import os

def combine(a, b):
return β€œHey! " + a + " " + b + β€˜\n’+ " Welcome to Machine Learning Nuggets.”

with gr.Blocks() as demo:

txt = gr.Textbox(label="First Name", lines=2)
txt_2 = gr.Textbox(label="Second Name")
txt_3 = gr.Textbox(value="", label="Output")
btn = gr.Button(value="Submit")
btn.click(combine, inputs=[txt, txt_2], outputs=[txt_3])

if name == β€œmain”:
demo.launch()

https://digitalpress.fra1.cdn.digitaloceanspaces.com/mhujhsj/2022/09/button.gif

2 Likes