Spaces:
Running
Running
commit
Browse files
app.py
CHANGED
@@ -127,7 +127,7 @@ pegasus_model = PegasusForConditionalGeneration.from_pretrained(pegasus_name)
|
|
127 |
|
128 |
def summarize_text(text, model_name="google/pegasus-xsum", max_length=30, num_beams=4, early_stopping=True):
|
129 |
return pegasus_tokenizer.decode( pegasus_model.generate(
|
130 |
-
pegasus_tokenizer(
|
131 |
max_length=max_length,
|
132 |
num_beams=num_beams,
|
133 |
early_stopping=early_stopping
|
|
|
127 |
|
128 |
def summarize_text(text, model_name="google/pegasus-xsum", max_length=30, num_beams=4, early_stopping=True):
|
129 |
return pegasus_tokenizer.decode( pegasus_model.generate(
|
130 |
+
pegasus_tokenizer(text,return_tensors="pt").input_ids,
|
131 |
max_length=max_length,
|
132 |
num_beams=num_beams,
|
133 |
early_stopping=early_stopping
|