MCPcopy Index your code
hub / github.com/huggingface/diffusers / is_nvidia_modelopt_version

Function is_nvidia_modelopt_version

src/diffusers/utils/import_utils.py:860–872  ·  view source on GitHub ↗

Compares the current Nvidia ModelOpt version to a given reference with an operation. Args: operation (`str`): A string representation of an operator, such as `">"` or `"<="` version (`str`): A version string

(operation: str, version: str)

Source from the content-addressed store, hash-verified

858
859@cache
860def is_nvidia_modelopt_version(operation: str, version: str):
861 """
862 Compares the current Nvidia ModelOpt version to a given reference with an operation.
863
864 Args:
865 operation (`str`):
866 A string representation of an operator, such as `">"` or `"<="`
867 version (`str`):
868 A version string
869 """
870 if not _nvidia_modelopt_available:
871 return False
872 return compare_versions(parse(_nvidia_modelopt_version), operation, version)
873
874
875@cache

Callers 1

decoratorFunction · 0.90

Calls 1

compare_versionsFunction · 0.85

Tested by 1

decoratorFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…