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"), inputs=[txt, txt_2], outputs=[txt_3])

if name == “main”:

1 Like