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

Function check_peft_version

src/diffusers/utils/peft_utils.py:327–344  ·  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

325
326
327def check_peft_version(min_version: str) -> None:
328 r"""
329 Checks if the version of PEFT is compatible.
330
331 Args:
332 version (`str`):
333 The version of PEFT to check against.
334 """
335 if not is_peft_available():
336 raise ValueError("PEFT is not installed. Please install it with `pip install peft`")
337
338 is_peft_version_compatible = version.parse(importlib.metadata.version("peft")) > version.parse(min_version)
339
340 if not is_peft_version_compatible:
341 raise ValueError(
342 f"The version of PEFT you are using is not compatible, please use a version that is greater"
343 f" than {min_version}"
344 )
345
346
347def _create_lora_config(

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…