logo
Browse Source

Fix cuda issue

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 2 years ago
parent
commit
0e4870b6e8
  1. 4
      s_bert.py

4
s_bert.py

@ -89,8 +89,8 @@ class STransformers(NNOperator):
else:
sentences = txt
inputs = self.tokenize(sentences)
for k, v in inputs.items():
inputs[k] = v.to(self.device)
# for k, v in inputs.items():
# inputs[k] = v.to(self.device)
embs = self.model(**inputs).cpu().detach().numpy()
if isinstance(txt, str):
embs = embs.squeeze(0)

Loading…
Cancel
Save