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

Closed
opened 2026-10-26 21:14:25 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @yuxianq on GitHub (Jan 16, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V3/issues/290

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~

Originally created by @yuxianq on GitHub (Jan 16, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V3/issues/290 **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~
Author
Owner

@enochkan commented on GitHub (Jan 25, 2025):

@yuxianq hi can you provide your python version please?

<!-- gh-comment-id:2614115489 --> @enochkan commented on GitHub (Jan 25, 2025): @yuxianq hi can you provide your python version please?
Author
Owner

@cmiqueo commented on GitHub (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

<!-- gh-comment-id:2614206745 --> @cmiqueo commented on GitHub (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
Author
Owner

@mowentian commented on GitHub (Jan 26, 2025):

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

<!-- gh-comment-id:2614218489 --> @mowentian commented on GitHub (Jan 26, 2025): > Linux with Python 3.10 only. Mac and Windows are not supported.
Author
Owner

@Jiadalee commented on GitHub (Jan 27, 2025):

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.

<!-- gh-comment-id:2616851910 --> @Jiadalee commented on GitHub (Jan 27, 2025): 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.
Author
Owner

@yuxianq commented on GitHub (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: https://github.com/huggingface/transformers/issues/35425 , it would help a lot if you can provide official support for them.

<!-- gh-comment-id:2630449492 --> @yuxianq commented on GitHub (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: https://github.com/huggingface/transformers/issues/35425 , it would help a lot if you can provide official support for them.
Author
Owner

@dinithaw commented on GitHub (Feb 3, 2025):

@yuxianq hi can you provide your python version please?

3.10 as far i can remember

<!-- gh-comment-id:2631183877 --> @dinithaw commented on GitHub (Feb 3, 2025): > @yuxianq hi can you provide your python version please? 3.10 as far i can remember
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-V3#109
No description provided.