logo
Browse Source

Optimize triton

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

4
auto_transformers.py

@ -128,12 +128,12 @@ class AutoTransformers(NNOperator):
log.error(f'Fail to tokenize inputs: {e}') log.error(f'Fail to tokenize inputs: {e}')
raise e raise e
try: try:
outs = self.model(**inputs)
outs = self.model(**inputs).to('cpu')
except Exception as e: except Exception as e:
log.error(f'Invalid input for the model: {self.model_name}') log.error(f'Invalid input for the model: {self.model_name}')
raise e raise e
outs = self.post_proc(outs, inputs) outs = self.post_proc(outs, inputs)
features = outs.cpu().detach().numpy()
features = outs.detach().numpy()
if isinstance(data, str): if isinstance(data, str):
features = features.squeeze(0) features = features.squeeze(0)
else: else:

Loading…
Cancel
Save