MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / is_transformers_version

Function is_transformers_version

diffusers/src/diffusers/utils/import_utils.py:703–715  ·  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

701
702
703def is_transformers_version(operation: str, version: str):
704 """
705 Compares the current Transformers version to a given reference with an operation.
706
707 Args:
708 operation (`str`):
709 A string representation of an operator, such as `">"` or `"<="`
710 version (`str`):
711 A version string
712 """
713 if not _transformers_available:
714 return False
715 return compare_versions(parse(_transformers_version), operation, version)
716
717
718def is_accelerate_version(operation: str, version: str):

Callers 14

requires_backendsFunction · 0.85
__init__.pyFile · 0.85
__init__.pyFile · 0.85
__init__.pyFile · 0.85
__init__.pyFile · 0.85
__init__.pyFile · 0.85
__init__.pyFile · 0.85
__init__.pyFile · 0.85
lora_pipeline.pyFile · 0.85

Calls 1

compare_versionsFunction · 0.85

Tested by

no test coverage detected