The DuplicateButton creates a button that duplicates the current Space on Hugging Face. Does nothing when running locally.
Basic usage
import gradio as gr
with gr.Blocks() as demo:
gr.DuplicateButton()
demo.launch()
Constructor
value
str
default:"'Duplicate Space'"
Button label text
variant
Literal['primary', 'secondary', 'stop', 'huggingface']
default:"'huggingface'"
Button style variant. Defaults to Hugging Face branded style
size
Literal['sm', 'md', 'lg']
default:"'sm'"
Button size
Example
import gradio as gr
with gr.Blocks() as demo:
gr.Markdown("# My Awesome Model")
gr.Markdown("Try it out below!")
# Add duplicate button for users to create their own copy
with gr.Row():
gr.DuplicateButton("Duplicate this Space")
# Your interface here
input = gr.Textbox()
output = gr.Textbox()
demo.launch()