Compares the current Transformers version to a given reference with an operation. Args: operation (`str`): A string representation of an operator, such as `">"` or `"<="` version (`str`): A version string
(operation: str, version: str)
| 715 | |
| 716 | @cache |
| 717 | def is_transformers_version(operation: str, version: str): |
| 718 | """ |
| 719 | Compares the current Transformers version to a given reference with an operation. |
| 720 | |
| 721 | Args: |
| 722 | operation (`str`): |
| 723 | A string representation of an operator, such as `">"` or `"<="` |
| 724 | version (`str`): |
| 725 | A version string |
| 726 | """ |
| 727 | if not _transformers_available: |
| 728 | return False |
| 729 | return compare_versions(parse(_transformers_version), operation, version) |
| 730 | |
| 731 | |
| 732 | @cache |
no test coverage detected
searching dependent graphs…