EE21 commited on
Commit
1724904
1 Parent(s): e09e77e

Update abstractive_summarization.py

Browse files
Files changed (1) hide show
  1. abstractive_summarization.py +1 -1
abstractive_summarization.py CHANGED
@@ -8,7 +8,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained("EE21/BART-ToSSimplify")
8
  def summarize_with_bart_ft(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=300, min_length=100, num_beams=1, early_stopping=False, length_penalty=1)
11
- summary = tokenizer.decode(summary_ids[0], skip_special_tokens=False)
12
  return summary
13
 
14
  # Function to summarize using BART-large-cnn
 
8
  def summarize_with_bart_ft(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=300, min_length=100, num_beams=1, early_stopping=False, length_penalty=1)
11
+ summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
12
  return summary
13
 
14
  # Function to summarize using BART-large-cnn