Spaces:
Sleeping
Sleeping
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() |