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

Function is_hf_hub_version

src/diffusers/utils/import_utils.py:749–761  ·  view source on GitHub ↗

Compares the current Hugging Face Hub 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

747
748@cache
749def is_hf_hub_version(operation: str, version: str):
750 """
751 Compares the current Hugging Face Hub version to a given reference with an operation.
752
753 Args:
754 operation (`str`):
755 A string representation of an operator, such as `">"` or `"<="`
756 version (`str`):
757 A version string
758 """
759 if not _hf_hub_available:
760 return False
761 return compare_versions(parse(_hf_hub_version), operation, version)
762
763
764@cache

Callers

nothing calls this directly

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…