Blaise-g commited on
Commit
aa0bfa7
Β·
1 Parent(s): e12f59b

Update summarize.py

Browse files
Files changed (1) hide show
  1. summarize.py +3 -3
summarize.py CHANGED
@@ -63,8 +63,8 @@ def summarize_and_score(ids, mask, model, tokenizer, **kwargs):
63
  remove_invalid_values=True,
64
  )
65
  score = round(summary_pred_ids.sequences_scores.cpu().numpy()[0], 4)
66
- #len_res = len(summary_pred_ids.sequences.cpu().numpy()[0])
67
- return summary, score#, len_res
68
 
69
 
70
  def summarize_via_tokenbatches(
@@ -124,7 +124,7 @@ def summarize_via_tokenbatches(
124
  "input_tokens": _id,
125
  "summary": result,
126
  "summary_score": score,
127
- #"compression_rate": rate,
128
  }
129
  gen_summaries.append(_sum)
130
  print(f"\t{result[0]}\nScore:\t{score}")
 
63
  remove_invalid_values=True,
64
  )
65
  score = round(summary_pred_ids.sequences_scores.cpu().numpy()[0], 4)
66
+ len_res = len(summary_pred_ids.sequences.cpu().numpy()[0])
67
+ return summary, score, len_res
68
 
69
 
70
  def summarize_via_tokenbatches(
 
124
  "input_tokens": _id,
125
  "summary": result,
126
  "summary_score": score,
127
+ "compression_rate": rate,
128
  }
129
  gen_summaries.append(_sum)
130
  print(f"\t{result[0]}\nScore:\t{score}")