Compares the current Hugging Face Hub 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)
| 747 | |
| 748 | @cache |
| 749 | def is_hf_hub_version(operation: str, version: str): |
| 750 | """ |
| 751 | Compares the current Hugging Face Hub version to a given reference with an operation. |
| 752 | |
| 753 | Args: |
| 754 | operation (`str`): |
| 755 | A string representation of an operator, such as `">"` or `"<="` |
| 756 | version (`str`): |
| 757 | A version string |
| 758 | """ |
| 759 | if not _hf_hub_available: |
| 760 | return False |
| 761 | return compare_versions(parse(_hf_hub_version), operation, version) |
| 762 | |
| 763 | |
| 764 | @cache |
nothing calls this directly
no test coverage detected
searching dependent graphs…