Checks if all backends are installed (otherwise the check of this script is incomplete). Will error in the CI if that's not the case but only throw a warning for users running this.
()
| 588 | |
| 589 | |
| 590 | def check_missing_backends(): |
| 591 | """ |
| 592 | Checks if all backends are installed (otherwise the check of this script is incomplete). Will error in the CI if |
| 593 | that's not the case but only throw a warning for users running this. |
| 594 | """ |
| 595 | missing_backends = [] |
| 596 | if not is_torch_available(): |
| 597 | missing_backends.append("PyTorch") |
| 598 | |
| 599 | if len(missing_backends) > 0: |
| 600 | missing = ", ".join(missing_backends) |
| 601 | if os.getenv("TRANSFORMERS_IS_CI", "").upper() in ENV_VARS_TRUE_VALUES: |
| 602 | raise Exception( |
| 603 | "Full repo consistency checks require all backends to be installed (with `pip install -e '.[dev]'` in the " |
| 604 | f"Transformers repo, the following are missing: {missing}." |
| 605 | ) |
| 606 | else: |
| 607 | warnings.warn( |
| 608 | "Full repo consistency checks require all backends to be installed (with `pip install -e '.[dev]'` in the " |
| 609 | f"Transformers repo, the following are missing: {missing}. While it's probably fine as long as you " |
| 610 | "didn't make any change in one of those backends modeling files, you should probably execute the " |
| 611 | "command above to be on the safe side." |
| 612 | ) |
| 613 | |
| 614 | |
| 615 | def check_model_list(): |
no test coverage detected