Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def extract_article_text(url):
|
|
23 |
def news_summarizer(url):
|
24 |
text = extract_article_text(url)
|
25 |
input_ids = tokenizer.encode_plus(text, return_tensors='pt', max_length=512, truncation=True, padding=True)['input_ids']
|
26 |
-
summary_ids = model.generate(input_ids,max_length=128,
|
27 |
summaries = [tokenizer.decode(s, skip_special_tokens=True) for s in summary_ids]
|
28 |
return summaries[0]
|
29 |
|
|
|
23 |
def news_summarizer(url):
|
24 |
text = extract_article_text(url)
|
25 |
input_ids = tokenizer.encode_plus(text, return_tensors='pt', max_length=512, truncation=True, padding=True)['input_ids']
|
26 |
+
summary_ids = model.generate(input_ids,max_length=128,min_length= 64)
|
27 |
summaries = [tokenizer.decode(s, skip_special_tokens=True) for s in summary_ids]
|
28 |
return summaries[0]
|
29 |
|