File size: 374 Bytes
ceef65d
 
 
b16e6cd
 
ceef65d
 
 
 
 
 
 
1c1f49c
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
from transformers import pipeline

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

def summarize(input):
    output = get_completion(input)
    return output[0]['summary_text']
    
gr.close_all()
demo = gr.Interface(fn=summarize, inputs="text", outputs="text")
demo.launch()