Jaykintecblic commited on
Commit
43a59c2
1 Parent(s): 4e28b18

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +6 -2
handler.py CHANGED
@@ -60,5 +60,9 @@ class EndpointHandler:
60
 
61
  generated_ids = self.model.generate(**inputs, bad_words_ids=self.bad_words_ids, max_length=4096)
62
  generated_text = self.processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
63
- print(generated_text)
64
- return {"text": generated_text}
 
 
 
 
 
60
 
61
  generated_ids = self.model.generate(**inputs, bad_words_ids=self.bad_words_ids, max_length=4096)
62
  generated_text = self.processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
63
+ # print(generated_text)
64
+ # return {"text": generated_text}
65
+ # Format the output as an array of dictionaries with 'label' and 'score'
66
+ output = [{"label": text, "score": 1.0} for text in generated_texts]
67
+
68
+ return output