summarization / app.py
git.name
adding share=True
29c63f6
raw
history blame contribute delete
673 Bytes
import gradio as gr
from transformers import pipeline
task = 'summarization'
model = 'sshleifer/distilbart-cnn-12-6'
get_completion = pipeline(task=task, model=model)
def summarize(input):
output = get_completion(input)
return output[0]['summary_text']
result = gr.Interface(fn=summarize,
inputs=[gr.TextArea(label='Text to summerize:')],
outputs=gr.TextArea(label='Summary'),
title='Text summerization with distilbart-cnn',
description="Summerize any text using `sshleifer/distilbart-cnn-12-6` model under the hood!"
)
result.launch(inline=False, share=True)