r""" Checks if the version of PEFT is compatible. Args: version (`str`): The version of PEFT to check against.
(min_version: str)
| 276 | |
| 277 | |
| 278 | def 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 | ) |
no test coverage detected