Skip to content

Bump `optimum` to 1.16.2 to resolve import error

Santosh Tirunagari requested to merge github/fork/tskir/patch-1 into main

Created by: tskir

As I was experimenting with the repository, I noticed that installing a blank virtual environment and following the instructions in README leads to:

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/ktsukanov/repositories/literature/annotation_models/myenv/lib/python3.10/site-packages/transformers/pytorch_utils.py)

This is because part of the code was recently removed in https://github.com/huggingface/transformers/pull/28207. This has then been addressed in https://github.com/huggingface/optimum/pull/1641, so upgrading to optimum==1.16.2 solves the problem.

Merge request reports

Loading