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

Function check_peft_version

diffusers/src/diffusers/utils/peft_utils.py:278–295  ·  view source on GitHub ↗

r""" Checks if the version of PEFT is compatible. Args: version (`str`): The version of PEFT to check against.

(min_version: str)

Source from the content-addressed store, hash-verified

276
277
278def check_peft_version(min_version: str) -> None:
279 r"""
280 Checks if the version of PEFT is compatible.
281
282 Args:
283 version (`str`):
284 The version of PEFT to check against.
285 """
286 if not is_peft_available():
287 raise ValueError("PEFT is not installed. Please install it with `pip install peft`")
288
289 is_peft_version_compatible = version.parse(importlib.metadata.version("peft")) > version.parse(min_version)
290
291 if not is_peft_version_compatible:
292 raise ValueError(
293 f"The version of PEFT you are using is not compatible, please use a version that is greater"
294 f" than {min_version}"
295 )

Callers 5

add_adapterMethod · 0.85
set_adapterMethod · 0.85
disable_adaptersMethod · 0.85
enable_adaptersMethod · 0.85
active_adaptersMethod · 0.85

Calls 1

is_peft_availableFunction · 0.85

Tested by

no test coverage detected