Alimubariz124's picture
Create app.py
6d5f333
raw
history blame contribute delete
427 Bytes
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()