Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
16d50045
Unverified
Commit
16d50045
authored
Nov 14, 2023
by
Richard Löwenström
Committed by
GitHub
Nov 14, 2023
Browse files
Use greater than or equal to in version comparisons for peft (#5785)
parent
210a07b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/diffusers/utils/constants.py
src/diffusers/utils/constants.py
+5
-5
No files found.
src/diffusers/utils/constants.py
View file @
16d50045
...
@@ -22,8 +22,8 @@ from .import_utils import is_peft_available, is_transformers_available
...
@@ -22,8 +22,8 @@ from .import_utils import is_peft_available, is_transformers_available
default_cache_path
=
HUGGINGFACE_HUB_CACHE
default_cache_path
=
HUGGINGFACE_HUB_CACHE
MIN_PEFT_VERSION
=
"0.
5
.0"
MIN_PEFT_VERSION
=
"0.
6
.0"
MIN_TRANSFORMERS_VERSION
=
"4.3
3.3
"
MIN_TRANSFORMERS_VERSION
=
"4.3
4.0
"
CONFIG_NAME
=
"config.json"
CONFIG_NAME
=
"config.json"
...
@@ -41,12 +41,12 @@ DEPRECATED_REVISION_ARGS = ["fp16", "non-ema"]
...
@@ -41,12 +41,12 @@ DEPRECATED_REVISION_ARGS = ["fp16", "non-ema"]
# Below should be `True` if the current version of `peft` and `transformers` are compatible with
# 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
# PEFT backend. Will automatically fall back to PEFT backend if the correct versions of the libraries are
# available.
# 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
(
_required_peft_version
=
is_peft_available
()
and
version
.
parse
(
version
.
parse
(
importlib
.
metadata
.
version
(
"peft"
)).
base_version
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
(
_required_transformers_version
=
is_transformers_available
()
and
version
.
parse
(
version
.
parse
(
importlib
.
metadata
.
version
(
"transformers"
)).
base_version
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
USE_PEFT_BACKEND
=
_required_peft_version
and
_required_transformers_version
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment