Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ pipe = pipeline("summarization", model="RajSang/pegasus-sports-titles")
|
|
5 |
|
6 |
def sportyify(article,length_penalty=0.6,diversity_penalty=2.0):
|
7 |
gen_kwargs = {"length_penalty":length_penalty,"num_beams":4, "num_return_sequences": 4,"num_beam_groups":4,"diversity_penalty":float(diversity_penalty)}
|
8 |
-
titles=[i["summary_text"]+'\n\n' for i in pipe(article, **gen_kwargs)]
|
9 |
returnable=''
|
10 |
for i,title in enumerate(titles):
|
11 |
returnable+='Title '+str(i+1)+' :\n\n'+title
|
|
|
5 |
|
6 |
def sportyify(article,length_penalty=0.6,diversity_penalty=2.0):
|
7 |
gen_kwargs = {"length_penalty":length_penalty,"num_beams":4, "num_return_sequences": 4,"num_beam_groups":4,"diversity_penalty":float(diversity_penalty)}
|
8 |
+
titles=[i["summary_text"]+'\n\n' for i in pipe(article, **gen_kwargs,truncation=True)]
|
9 |
returnable=''
|
10 |
for i,title in enumerate(titles):
|
11 |
returnable+='Title '+str(i+1)+' :\n\n'+title
|