import gradio as gr from transformers import pipeline summarizer = pipeline("summarization", model="facebook/bart-large-cnn") def f(x): return summarizer(x, max_length=160, min_length=40, do_sample=False)[0]['summary_text'] iface = gr.Interface(fn=f, inputs="text", outputs="text") iface.launch(share=True)