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

Fix cached_path error with transformers v4.22 #340

Closed
davidmezzetti opened this issue Sep 15, 2022 · 1 comment
Closed

Fix cached_path error with transformers v4.22 #340

davidmezzetti opened this issue Sep 15, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@davidmezzetti
Copy link
Member

Transformers v4.22 removed the cached_path method with huggingface/transformers#18497.

This is resulting in the following error when running with transformers==4.22.0

ImportError: cannot import name 'cached_path' from 'transformers.file_utils'

The translation pipeline needs to be updated with an equivalent way to run cached_path like functionality for files not on the Hugging Face Hub.

The workaround for txtai < 5.0 is to pin transformers to <= 4.21.3.

@davidmezzetti davidmezzetti added the bug Something isn't working label Sep 15, 2022
@davidmezzetti davidmezzetti added this to the v5.0.0 milestone Sep 15, 2022
@davidmezzetti davidmezzetti self-assigned this Sep 15, 2022
@davidmezzetti
Copy link
Member Author

This issue also addresses a UserWarning in the translation pipeline regarding setting max_length in the model.generate call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant