jpohhhh commited on
Commit
52b2458
·
1 Parent(s): f9063f4

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -52,11 +52,11 @@ class EndpointHandler():
52
  model_output = self.onnx_extractor(sentence)
53
  print("E")
54
 
55
- sentence_embeddings_max = [max(col) for col in zip(*model_output)]
56
  # Perform pooling. In this case, max pooling.
57
  # embedding = mean_pooling(model_output, encoded_input['attention_mask'])
58
  print("F")
59
 
60
- sentence_embeddings.append(sentence_embeddings_max)
61
  print("G")
62
  return sentence_embeddings
 
52
  model_output = self.onnx_extractor(sentence)
53
  print("E")
54
 
55
+ max_pooled_output, _ = torch.max(model_output, dim=1)
56
  # Perform pooling. In this case, max pooling.
57
  # embedding = mean_pooling(model_output, encoded_input['attention_mask'])
58
  print("F")
59
 
60
+ sentence_embeddings.append(max_pooled_output)
61
  print("G")
62
  return sentence_embeddings