Skip to content

Commit

Permalink
Use greater than or equal to in version comparisons for peft (hugging…
Browse files Browse the repository at this point in the history
  • Loading branch information
samedii authored Nov 14, 2023
1 parent 210a07b commit 16d5004
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/diffusers/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

default_cache_path = HUGGINGFACE_HUB_CACHE

MIN_PEFT_VERSION = "0.5.0"
MIN_TRANSFORMERS_VERSION = "4.33.3"
MIN_PEFT_VERSION = "0.6.0"
MIN_TRANSFORMERS_VERSION = "4.34.0"


CONFIG_NAME = "config.json"
Expand All @@ -41,12 +41,12 @@
# Below should be `True` if the current version of `peft` and `transformers` are compatible with
# PEFT backend. Will automatically fall back to PEFT backend if the correct versions of the libraries are
# available.
# For PEFT it is has to be greater than 0.6.0 and for transformers it has to be greater than 4.33.1.
# For PEFT it is has to be greater than or equal to 0.6.0 and for transformers it has to be greater than or equal to 4.34.0.
_required_peft_version = is_peft_available() and version.parse(
version.parse(importlib.metadata.version("peft")).base_version
) > version.parse(MIN_PEFT_VERSION)
) >= version.parse(MIN_PEFT_VERSION)
_required_transformers_version = is_transformers_available() and version.parse(
version.parse(importlib.metadata.version("transformers")).base_version
) > version.parse(MIN_TRANSFORMERS_VERSION)
) >= version.parse(MIN_TRANSFORMERS_VERSION)

USE_PEFT_BACKEND = _required_peft_version and _required_transformers_version

0 comments on commit 16d5004

Please sign in to comment.