andrewluo commited on
Commit
5761c76
1 Parent(s): eb38ce4

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -17,6 +17,6 @@ class EndpointHandler():
17
  # get inputs
18
  instruction = data.pop("instruction",data)
19
  text = data.pop("text", data)
20
-
21
- embeddings = self.model.encode([[instruction,text]])
22
- return embeddings[0].tolist()
 
17
  # get inputs
18
  instruction = data.pop("instruction",data)
19
  text = data.pop("text", data)
20
+ inputs = [(s, instruction) for s in text]
21
+ embeddings = self.model.encode(inputs)
22
+ return embeddings.tolist()