Update handler.py
Browse files- handler.py +4 -4
handler.py
CHANGED
@@ -52,8 +52,8 @@ class EndpointHandler():
|
|
52 |
else:
|
53 |
output = self.model.generate(input_ids=input_ids, attention_mask=attention_mask)
|
54 |
# Postprocess
|
55 |
-
|
56 |
-
|
57 |
-
prediction = self.tokenizer.decode(output[0])
|
58 |
LOGGER.info(f"Generated text: {prediction}")
|
59 |
-
|
|
|
|
52 |
else:
|
53 |
output = self.model.generate(input_ids=input_ids, attention_mask=attention_mask)
|
54 |
# Postprocess
|
55 |
+
|
56 |
+
prediction = self.tokenizer.decode(output[0], skip_special_tokens=True)
|
|
|
57 |
LOGGER.info(f"Generated text: {prediction}")
|
58 |
+
|
59 |
+
return [{"generated_text": prediction}]
|