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

Function is_accelerate_version

src/diffusers/utils/import_utils.py:765–777  ·  view source on GitHub ↗

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

763
764@cache
765def is_accelerate_version(operation: str, version: str):
766 """
767 Compares the current Accelerate version to a given reference with an operation.
768
769 Args:
770 operation (`str`):
771 A string representation of an operator, such as `">"` or `"<="`
772 version (`str`):
773 A version string
774 """
775 if not _accelerate_available:
776 return False
777 return compare_versions(parse(_accelerate_version), operation, version)
778
779
780@cache

Callers 15

mainFunction · 0.90
mainFunction · 0.90
load_lora_weightsMethod · 0.90
module_is_offloadedMethod · 0.85
toMethod · 0.85
from_pretrainedMethod · 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…