Spaces:
Runtime error
Runtime error
tomsoderlund
commited on
Commit
·
7180e60
1
Parent(s):
e844261
short_text max 1024
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ from transformers import pipeline
|
|
3 |
|
4 |
def summarize_text(text, min_length, max_length):
|
5 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
6 |
-
|
|
|
7 |
print("** summary", summary)
|
8 |
return summary[0]["summary_text"]
|
9 |
|
|
|
3 |
|
4 |
def summarize_text(text, min_length, max_length):
|
5 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
6 |
+
short_text = text[:1024]
|
7 |
+
summary = summarizer(short_text, max_length, min_length, do_sample=False)
|
8 |
print("** summary", summary)
|
9 |
return summary[0]["summary_text"]
|
10 |
|