Tidzo commited on
Commit
27c2c1c
·
1 Parent(s): 5e79841

Update handler.py

Browse files
Files changed (1) hide show
  1. 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
- LOGGER.info(output)
56
- print(output)
57
- prediction = self.tokenizer.decode(output[0])
58
  LOGGER.info(f"Generated text: {prediction}")
59
- return {"generated_text": prediction}
 
 
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}]