Lahiru Menikdiwela commited on
Commit
6238067
·
1 Parent(s): 09fa1cc

adjusting max tokens

Browse files
Files changed (1) hide show
  1. summarizer.py +1 -1
summarizer.py CHANGED
@@ -62,7 +62,7 @@ def summarizer_summarize(model_type,tokenizer, base_summarizer, text:str,summari
62
  inputs = tokenizer(prompt,
63
  return_tensors="pt", truncation=True).to('cpu')
64
  attention_mask = inputs["attention_mask"]
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,
 
62
  inputs = tokenizer(prompt,
63
  return_tensors="pt", truncation=True).to('cpu')
64
  attention_mask = inputs["attention_mask"]
65
+ approximate_tokens = int(len(text)//8)
66
  output = base_summarizer.generate(inputs['input_ids'],
67
  attention_mask = attention_mask,
68
  top_k=10, max_new_tokens=approximate_tokens+25,