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

[BUG] Fail to import is_torch_greater_or_equal_than_1_13 since transformers v4.48.0 for all deepseek models #290

Closed
yuxianq opened this issue Jan 16, 2025 · 6 comments

Comments

@yuxianq
Copy link

yuxianq commented Jan 16, 2025

Describe the bug
Fail to import is_torch_greater_or_equal_than_1_13 since transformers v4.48.0 for all deepseek models

To Reproduce
Install transformers v4.48.0 and run any deepseek model.

Expected behavior
Can run deepseek models with transformers v4.48.0.

Additional context
is_torch_greater_or_equal_than_1_13 has been removed since transformers v4.48.0, it is necessary to remove all usage of is_torch_greater_or_equal_than_1_13 from all deepseek models, not only this one. Can the maintainers help to fix all the models? It is important for us to provide deepseek model support in TensorRT-LLM. Thanks~

@enochkan
Copy link
Contributor

@yuxianq hi can you provide your python version please?

@cmiqueo
Copy link

cmiqueo commented Jan 26, 2025

@enochkan I have the same problem:

An error occurred: cannot import name 'is_torch_greater_or_equal_than_1_13' from 'transformers.pytorch_utils' (/Users/username/.pyenv/versions/myenv/lib/python3.9/site-packages/transformers/pytorch_utils.py)

Python 3.9.20

@mowentian
Copy link
Contributor

Linux with Python 3.10 only. Mac and Windows are not supported.

@Jiadalee
Copy link

Only python 3.10 working? I have python 3.12 and tried transformers 4.37.2 and 4.48.0, but still pops with the same error.

@yuxianq
Copy link
Author

yuxianq commented Feb 3, 2025

Sorry that I am still on vocation.
@mowentian I use Python 3.12.3. Please noting that this issue is not about Python version but HF version instead. HF removes is_torch_greater_or_equal_than_1_13 in https://github.com/huggingface/transformers/pull/35358/files#diff-dba11d4c8294d6ccc1f120918ba0921738444244db666e0bbde15dc9eb212128L38 since v4.48.0, which breaks deepseek's modeling files.

One way to fix it is removing the usage of is_torch_greater_or_equal_than_1_13 from your model checkpoints. Another way is to integrate deepseek models into HF. There is an ongoing effort: huggingface/transformers#35425 , it would help a lot if you can provide official support for them.

@dinithaw
Copy link

dinithaw commented Feb 3, 2025

@yuxianq hi can you provide your python version please?

3.10 as far i can remember

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

6 participants