errors.py 347 B

12345678910111213
  1. import wandb
  2. class MissingDependencyError(Exception):
  3. """An optional dependency is missing."""
  4. def __init__(self, *args: object, warning: str) -> None:
  5. super().__init__(*args)
  6. self._wb_warning = warning
  7. def warn(self) -> None:
  8. """Print a warning for the problem."""
  9. wandb.termwarn(self._wb_warning)