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)
| 701 | |
| 702 | |
| 703 | def is_transformers_version(operation: str, version: str): |
| 704 | """ |
| 705 | Compares the current Transformers version to a given reference with an operation. |
| 706 | |
| 707 | Args: |
| 708 | operation (`str`): |
| 709 | A string representation of an operator, such as `">"` or `"<="` |
| 710 | version (`str`): |
| 711 | A version string |
| 712 | """ |
| 713 | if not _transformers_available: |
| 714 | return False |
| 715 | return compare_versions(parse(_transformers_version), operation, version) |
| 716 | |
| 717 | |
| 718 | def is_accelerate_version(operation: str, version: str): |
no test coverage detected