news_summary / app.py
stephenhage
return just summary text
db95b31
raw
history blame
364 Bytes
import gradio as gr
from transformers import pipeline
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
def greet(article, max_length=130, min_length=30, do_sample=False):
return summarizer(article, max_length, min_length, do_sample)[0].get('summaray_text')
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()