Michael Brunzel
commited on
Commit
•
bb8956c
1
Parent(s):
d381ece
Update input ids filtering
Browse files- handler.py +2 -2
handler.py
CHANGED
@@ -71,9 +71,9 @@ class EndpointHandler:
|
|
71 |
if parameters is not None:
|
72 |
outputs = self.model.generate(input_ids=input_ids, **parameters)
|
73 |
else:
|
74 |
-
outputs = self.model.generate(input_ids=input_ids, max_new_tokens=
|
75 |
|
76 |
# postprocess the prediction
|
77 |
-
prediction = self.tokenizer.decode(outputs[0]) #, skip_special_tokens=True)
|
78 |
prediction = prediction.split("<|endoftext|>")[0]
|
79 |
return [{"generated_text": prediction}]
|
|
|
71 |
if parameters is not None:
|
72 |
outputs = self.model.generate(input_ids=input_ids, **parameters)
|
73 |
else:
|
74 |
+
outputs = self.model.generate(input_ids=input_ids, max_new_tokens=20)
|
75 |
|
76 |
# postprocess the prediction
|
77 |
+
prediction = self.tokenizer.decode(outputs[0][input_ids.shape[1]:]) #, skip_special_tokens=True)
|
78 |
prediction = prediction.split("<|endoftext|>")[0]
|
79 |
return [{"generated_text": prediction}]
|