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

Cannot use pop on a ModelOutput instance. (transformers) #75

Open
alexlorans opened this issue Mar 19, 2024 · 2 comments
Open

Cannot use pop on a ModelOutput instance. (transformers) #75

alexlorans opened this issue Mar 19, 2024 · 2 comments

Comments

@alexlorans
Copy link

Hi, I had a problem. When I run the file I get an error:
File "/usr/local/lib/python3.10/dist-packages/transformers/utils/generic.py", line 376, in pop
raise Exception(f"You cannot use pop on a {self.class.name} instance.")
Exception: You cannot use pop on a ModelOutput instance.

I saw here on GitHub that some ppl solve this by downgrading the transformers library at version 4.23.0, but when I try to do the same thing I get an error on installation:

ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

Any ideas?

I saw on the internet that some ppl solve this by installing rust, but I get the same error.

Thanks

@SakshamDhawan
Copy link

Hi, all, I'm facing the same problem as above..
If anyone has found a fix, please update 👍

@alexlorans
Copy link
Author

Hi, @SakshamDhawan one method that you will find here is to downgrade transformers

pip uninstall transformers
pip install transformers==4.23

and install it with this version, but for me after this i got an error with tokenizer(you cand see my comment in linke above) and i manage to solve all of this by using python 3.10 or 3.9.x but not python 3.11. Just create a new env and it should be ok.

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

No branches or pull requests

2 participants