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

transformers version is not correct #25

Open
Navid-visual opened this issue Dec 21, 2023 · 0 comments
Open

transformers version is not correct #25

Navid-visual opened this issue Dec 21, 2023 · 0 comments

Comments

@Navid-visual
Copy link

Running the code faces an error because it cannot import LlamaTokenizer.

File "/local/home/.../SparseGPT/datautils.py", line 6, in <module>
    from transformers import AutoTokenizer, LlamaTokenizer
ImportError: cannot import name 'LlamaTokenizer' from 'transformers' 

If you update to the latest version you run into.a different issue:raise OSError(

OSError: Unable to load weights from pytorch checkpoint file for '/home/.../.cache/huggingface/hub/models--facebook--opt-125m/snapshots/27dcfa74d334bc871f3234de431e71c6eeba5dd6/pytorch_model.bin' at '/home/.../.cache/huggingface/hub/models--facebook--opt-125m/snapshots/27dcfa74d334bc871f3234de431e71c6eeba5dd6/pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

The best workaround is to use transformers v4.21.2 and remove the LlamaTokenizer from line 6 of datautils.py.

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

1 participant