Browse Source
flatten the output vector.
Signed-off-by: wxywb <xy.wang@zilliz.com>
main
wxywb
3 years ago
1 changed files with
1 additions and
1 deletions
-
clip.py
|
@ -49,7 +49,7 @@ class Clip(NNOperator): |
|
|
vec = self._inference_from_text(data) |
|
|
vec = self._inference_from_text(data) |
|
|
else: |
|
|
else: |
|
|
raise ValueError("modality[{}] not implemented.".format(self._modality)) |
|
|
raise ValueError("modality[{}] not implemented.".format(self._modality)) |
|
|
return vec.detach().cpu().numpy() |
|
|
|
|
|
|
|
|
return vec.detach().cpu().numpy().flatten() |
|
|
|
|
|
|
|
|
def _inference_from_text(self, text): |
|
|
def _inference_from_text(self, text): |
|
|
text = self.tokenize(text).to(self.device) |
|
|
text = self.tokenize(text).to(self.device) |
|
|