You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/mnt/data/work/.conda/envs/torch_env/lib/python3.8/site-packages/optimum/modeling_base.py", line 90, in call
return self.forward(*args, **kwargs)
File "/mnt/data/work/.conda/envs/torch_env/lib/python3.8/site-packages/optimum/onnxruntime/modeling_ort.py", line 960, in forward
last_hidden_state = outputs[self.output_names["last_hidden_state"]]
KeyError: 'last_hidden_state'
The text was updated successfully, but these errors were encountered:
If I update to optimum==1.21.2 from optimum==1.16.2 I get back the old error:
from optimum.onnxruntime import ORTModelForFeatureExtraction
File "<frozen importlib._bootstrap>", line 1039, in _handle_fromlist
File "/home/coder/.local/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1550, in __getattr__
module = self._get_module(self._class_to_module[name])
File "/home/coder/.local/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1562, in _get_module
raise RuntimeError(
RuntimeError: Failed to import optimum.onnxruntime.modeling_ort because of the following error (look up to see its traceback):
Failed to import optimum.exporters.onnx.__main__ because of the following error (look up to see its traceback):
cannot import name 'is_torch_less_than_1_11' from 'transformers.pytorch_utils' (/home/coder/.local/lib/python3.8/site-packages/transformers/pytorch_utils.py)
System Info
Who can help?
@michaelbenayoun
@JingyaHuang
@echarlaix
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction (minimal, reproducible, runnable)
export model and predict code
`
pretrained_model_path = './checkpoints/bge-base-zh'
export_model_path = './checkpoints/onnx'
`
Expected behavior
use bge-base-zh model than have two errors
return self.forward(*args, **kwargs)
File "/mnt/data/work/.conda/envs/torch_env/lib/python3.8/site-packages/optimum/onnxruntime/modeling_ort.py", line 960, in forward
last_hidden_state = outputs[self.output_names["last_hidden_state"]]
KeyError: 'last_hidden_state'
The text was updated successfully, but these errors were encountered: