Update handler.py
Browse files- handler.py +8 -1
handler.py
CHANGED
|
@@ -34,4 +34,11 @@ class EndpointHandler:
|
|
| 34 |
predictions = self.pipeline(inputs)
|
| 35 |
|
| 36 |
# postprocess the prediction
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
predictions = self.pipeline(inputs)
|
| 35 |
|
| 36 |
# postprocess the prediction
|
| 37 |
+
results = []
|
| 38 |
+
for e in predictions:
|
| 39 |
+
e_turn = e[0]["generated_text"][-1]
|
| 40 |
+
results.append({
|
| 41 |
+
'next_chat_turn': e_turn,
|
| 42 |
+
'next_chat_text': e_turn['content'],
|
| 43 |
+
})
|
| 44 |
+
return results
|