dgunzy commited on
Commit
25faaaa
1 Parent(s): 7826a71

Update handler.py

Browse files

trying new generation paramaters

Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -20,7 +20,7 @@ class EndpointHandler():
20
  tokenized_input = self.tokenizer(inputs, return_tensors="pt", truncation=True, max_length=512, padding="max_length")
21
  tokenized_input = tokenized_input.to(self.device) # Move input tensors to the same device as model
22
 
23
- summary_ids = self.model.generate(**tokenized_input, max_length=300, num_beams=4, early_stopping=True)
24
 
25
  summary_text = self.tokenizer.decode(summary_ids[0], skip_special_tokens=True)
26
 
 
20
  tokenized_input = self.tokenizer(inputs, return_tensors="pt", truncation=True, max_length=512, padding="max_length")
21
  tokenized_input = tokenized_input.to(self.device) # Move input tensors to the same device as model
22
 
23
+ summary_ids = self.model.generate(**tokenized_input, max_length=400, do_sample=True, top_p=0.8)
24
 
25
  summary_text = self.tokenizer.decode(summary_ids[0], skip_special_tokens=True)
26