Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
@@ -41,9 +41,9 @@ class EndpointHandler:
|
|
41 |
|
42 |
# pass inputs with all kwargs in data
|
43 |
if parameters is not None:
|
44 |
-
outputs = self.model.generate(inputs,
|
45 |
else:
|
46 |
-
outputs = self.model.generate(inputs,
|
47 |
|
48 |
# postprocess the prediction
|
49 |
prediction = self.tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
|
|
|
41 |
|
42 |
# pass inputs with all kwargs in data
|
43 |
if parameters is not None:
|
44 |
+
outputs = self.model.generate(inputs, num_return_sequences=1, eos_token_id=self.tokenizer.eos_token_id, **parameters) # removed max_new_tokens=880, will test and pass in max_new_tokens in config later
|
45 |
else:
|
46 |
+
outputs = self.model.generate(inputs, num_return_sequences=1, eos_token_id=self.tokenizer.eos_token_id)
|
47 |
|
48 |
# postprocess the prediction
|
49 |
prediction = self.tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
|