Uan Sholanbayev
commited on
Commit
•
582955e
1
Parent(s):
1d62fed
added model
Browse files- handler.py +3 -2
handler.py
CHANGED
@@ -28,8 +28,9 @@ class EndpointHandler():
|
|
28 |
return outputs.last_hidden_state.mean(dim=1).cpu().numpy()
|
29 |
|
30 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
31 |
-
|
32 |
-
|
|
|
33 |
queries_vec = self.get_embeddings(queries)
|
34 |
texts_vec = self.get_embeddings(texts)
|
35 |
diff = (np.array(texts_vec)[:, np.newaxis] - np.array(queries_vec))\
|
|
|
28 |
return outputs.last_hidden_state.mean(dim=1).cpu().numpy()
|
29 |
|
30 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
31 |
+
inputs = data.pop("inputs",data)
|
32 |
+
queries = inputs['queries']
|
33 |
+
texts = inputs['texts']
|
34 |
queries_vec = self.get_embeddings(queries)
|
35 |
texts_vec = self.get_embeddings(texts)
|
36 |
diff = (np.array(texts_vec)[:, np.newaxis] - np.array(queries_vec))\
|