r""" Checks if the version of PEFT is compatible. Args: version (`str`): The version of PEFT to check against.
(min_version: str)
| 325 | |
| 326 | |
| 327 | def 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 | |
| 347 | def _create_lora_config( |
no test coverage detected
searching dependent graphs…