cyqm commited on
Commit
15cdada
·
1 Parent(s): 247c739

Update handler

Browse files
Files changed (1) hide show
  1. handler.py +6 -1
handler.py CHANGED
@@ -46,7 +46,12 @@ class EndpointHandler:
46
  model_inputs = self.tokenizer([text], return_tensors="pt").to("cuda")
47
 
48
  time_start = time.time()
49
- generated_ids = self.model.generate(**model_inputs, max_new_tokens=max_new_tokens)
 
 
 
 
 
50
  time_end = time.time()
51
 
52
  num_new_tokens = len(generated_ids[0]) - len(model_inputs[0])
 
46
  model_inputs = self.tokenizer([text], return_tensors="pt").to("cuda")
47
 
48
  time_start = time.time()
49
+ generated_ids = self.model.generate(
50
+ **model_inputs,
51
+ max_new_tokens=max_new_tokens,
52
+ temperature=1.0,
53
+ **parameters
54
+ )
55
  time_end = time.time()
56
 
57
  num_new_tokens = len(generated_ids[0]) - len(model_inputs[0])