Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump optimum to 1.16.2 to resolve import error #4

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

tskir
Copy link
Contributor

@tskir tskir commented Jan 22, 2024

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 huggingface/transformers#28207. This has then been addressed in huggingface/optimum#1641, so upgrading to optimum==1.16.2 solves the problem.

@tskir
Copy link
Contributor Author

tskir commented Jan 22, 2024

P. S. I've checked that after this change the example output isn't materially affected (positions & entities are all the same, confidence scores vary within <0.1%), but of course I couldn't check the entire dataset & performance 🙃

@tsantosh7 tsantosh7 merged commit b3063f2 into ML4LitS:main Jan 22, 2024
@tsantosh7
Copy link
Member

Yes I recently noticed this. Totally agree 👍🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants