File size: 294 Bytes
659aa91
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from transformers import pipeline
import gradio as gr

model = pipeline("summarization")

def predict(text):
    return model(text)[0]['summary_text']

textbox = gr.Textbox(placeholder="Paste your text here to summarize", lines=5)
gr.Interface(predict, inputs=textbox, outputs="text").launch()