Lahiru Menikdiwela
commited on
Commit
·
09fa1cc
1
Parent(s):
793459b
fix max_new_toke_issue
Browse files- summarizer.py +1 -1
summarizer.py
CHANGED
@@ -65,7 +65,7 @@ def summarizer_summarize(model_type,tokenizer, base_summarizer, text:str,summari
|
|
65 |
approximate_tokens = int(len(text)//10)
|
66 |
output = base_summarizer.generate(inputs['input_ids'],
|
67 |
attention_mask = attention_mask,
|
68 |
-
top_k=10, max_new_tokens=approximate_tokens,
|
69 |
pad_token_id = tokenizer.eos_token_id)
|
70 |
|
71 |
base_summary = tokenizer.batch_decode(output[:, inputs['input_ids'].shape[-1]:], skip_special_tokens=True)
|
|
|
65 |
approximate_tokens = int(len(text)//10)
|
66 |
output = base_summarizer.generate(inputs['input_ids'],
|
67 |
attention_mask = attention_mask,
|
68 |
+
top_k=10, max_new_tokens=approximate_tokens+25,
|
69 |
pad_token_id = tokenizer.eos_token_id)
|
70 |
|
71 |
base_summary = tokenizer.batch_decode(output[:, inputs['input_ids'].shape[-1]:], skip_special_tokens=True)
|