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

Function is_transformers_version

src/diffusers/utils/import_utils.py:717–729  ·  view source on GitHub ↗

Compares the current Transformers 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

715
716@cache
717def is_transformers_version(operation: str, version: str):
718 """
719 Compares the current Transformers version to a given reference with an operation.
720
721 Args:
722 operation (`str`):
723 A string representation of an operator, such as `">"` or `"<="`
724 version (`str`):
725 A version string
726 """
727 if not _transformers_available:
728 return False
729 return compare_versions(parse(_transformers_version), operation, version)
730
731
732@cache

Callers 15

test_glm_image.pyFile · 0.90
requires_backendsFunction · 0.85
filter_model_filesFunction · 0.85
load_sub_modelFunction · 0.85
toMethod · 0.85

Calls 1

compare_versionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…