juanpablomesa commited on
Commit
cd3d8c2
·
1 Parent(s): fbe7fc9

Fixed normalization error when only 1 image is sent to endpoint

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -227,8 +227,8 @@ class EndpointHandler:
227
  # NORMALIZE
228
  if batch_emb.ndim > 1:
229
  batch_emb = batch_emb.T / np.linalg.norm(batch_emb, axis=1)
230
- # transpose back to (21, 512)
231
- batch_emb = batch_emb.T.tolist()
232
  embedding_end_time = timeit.default_timer()
233
  self.logger.info(
234
  f"Embedding calculation took {embedding_end_time - embedding_start_time} seconds"
 
227
  # NORMALIZE
228
  if batch_emb.ndim > 1:
229
  batch_emb = batch_emb.T / np.linalg.norm(batch_emb, axis=1)
230
+ # transpose back to (21, 512)
231
+ batch_emb = batch_emb.T.tolist()
232
  embedding_end_time = timeit.default_timer()
233
  self.logger.info(
234
  f"Embedding calculation took {embedding_end_time - embedding_start_time} seconds"