Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
pipe = pipeline("summarization", model="RajSang/pegasus-sports-titles") | |
def sportyify(article): | |
gen_kwargs = {"length_penalty":0.6,"num_beams":4, "max_length": 48} | |
return pipe(article, **gen_kwargs)[0]["summary_text"] | |
iface = gr.Interface(fn=sportyify, | |
inputs=gr.inputs.Textbox(lines=50, placeholder="Paste Article Text Here"), | |
outputs="text", | |
title="SPORT-Y Titles", | |
description="Generate titles for sports articles and sports news") | |
iface.launch(enable_queue=True) |