Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,6 @@ mdl_name = "google/pegasus-xsum"
|
|
| 4 |
pegasus_tkn = PegasusTokenizer.from_pretrained(mdl_name)
|
| 5 |
mdl = PegasusForConditionalGeneration.from_pretrained(mdl_name)
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
def summarize(text):
|
| 11 |
tokens = pegasus_tkn(text, truncation=True, padding="longest", return_tensors="pt")
|
| 12 |
txt_summary = mdl.generate(**tokens)
|
|
|
|
| 4 |
pegasus_tkn = PegasusTokenizer.from_pretrained(mdl_name)
|
| 5 |
mdl = PegasusForConditionalGeneration.from_pretrained(mdl_name)
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
def summarize(text):
|
| 8 |
tokens = pegasus_tkn(text, truncation=True, padding="longest", return_tensors="pt")
|
| 9 |
txt_summary = mdl.generate(**tokens)
|