Skip to content

Conversation

@RIP-Skillan
Copy link

@RIP-Skillan RIP-Skillan commented Sep 24, 2025

This is the solution as mentioned in the discussion #2660
It fixes for Pytorch version check issue for adding 'weights_only' argument. Added a more accurate version parser.

Original Code:

kwargs = {"weights_only": True} if torch.__version__ >= "1.13" else {}

Fixed Version Check using Version Parser:

from packaging import version
kwargs = {"weights_only": True} if version.parse(torch.__version__ ) >= version.parse("1.13") else {}

Fix for Pytorch version check issue for adding 'weights_only' argument. Added a more accurate version parser.
version parsing which could originally be done using pkg_resources is deprecated from python 3.12, therefore requiring packaging to handle version parsing
Since pkg_resources has been deprecated from python 3.12, we have to use 'packaging' to handle the version parsing instead.
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

Successfully merging this pull request may close these issues.

1 participant