Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#535 Bug/sg 000 torch version fix

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:bug/SG-000_torch_version_fix
2 changed files with 7 additions and 1 deletions
  1. 1
    1
      requirements.txt
  2. 6
    0
      src/super_gradients/sanity_check/env_sanity_check.py
@@ -1,4 +1,4 @@
-torch>=1.9.0
+torch>=1.9.0,<=1.12
 tqdm>=4.57.0
 tqdm>=4.57.0
 boto3>=1.17.15
 boto3>=1.17.15
 jsonschema>=3.2.0
 jsonschema>=3.2.0
Discard
@@ -82,6 +82,11 @@ def verify_installed_libraries() -> List[str]:
 
 
         lib, required_version_str = requirement.split(constraint)
         lib, required_version_str = requirement.split(constraint)
 
 
+        if ",<=" in required_version_str:
+            upper_limit_version = Version(required_version_str.split(",<=")[1])
+            required_version_str = required_version_str.split(",<=")[0]
+            constraint += ",<="
+
         if lib.lower() not in installed_libs_with_version.keys():
         if lib.lower() not in installed_libs_with_version.keys():
             errors.append(f"{lib} required but not found")
             errors.append(f"{lib} required but not found")
             continue
             continue
@@ -90,6 +95,7 @@ def verify_installed_libraries() -> List[str]:
         installed_version, required_version = Version(installed_version_str), Version(required_version_str)
         installed_version, required_version = Version(installed_version_str), Version(required_version_str)
 
 
         is_constraint_respected = {
         is_constraint_respected = {
+            ">=,<=": required_version <= installed_version <= upper_limit_version,
             ">=": installed_version >= required_version,
             ">=": installed_version >= required_version,
             "~=": (
             "~=": (
                 installed_version.major == required_version.major
                 installed_version.major == required_version.major
Discard