Spaces:
Runtime error
Runtime error
Update abstractive_model.py
Browse files- abstractive_model.py +1 -1
abstractive_model.py
CHANGED
@@ -8,5 +8,5 @@ model = AutoModelForSeq2SeqLM.from_pretrained("EE21/BART-ToSSimplify")
|
|
8 |
def summarize_with_bart(input_text):
|
9 |
inputs = tokenizer.encode("summarize: " + input_text, return_tensors="pt", max_length=1024, truncation=True)
|
10 |
summary_ids = model.generate(inputs, max_length=200, min_length=50, num_beams=1, early_stopping=False, length_penalty=1)
|
11 |
-
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=
|
12 |
return summary
|
|
|
8 |
def summarize_with_bart(input_text):
|
9 |
inputs = tokenizer.encode("summarize: " + input_text, return_tensors="pt", max_length=1024, truncation=True)
|
10 |
summary_ids = model.generate(inputs, max_length=200, min_length=50, num_beams=1, early_stopping=False, length_penalty=1)
|
11 |
+
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=False)
|
12 |
return summary
|