File size: 427 Bytes
6d5f333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from transformers import pipeline

get_completion = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")

def summarize(input):
    output = get_completion(input)
    return output[0]['summary_text']

iface = gr.Interface(
    fn=summarize,
    inputs="text",
    outputs="text",
    title="Text Summarization",
    description="Summarize input text using a pre-trained model."
)

iface.launch()