Download 1.3B/code/utils/optional_wandb.py from Elastic-forcing/Elastic-forcing-code: direct link, hf CLI and curl.
- Browser
- Download file 487 Bytes
-
https://huggingface.co/Elastic-forcing/Elastic-forcing-code/resolve/main/1.3B/code/utils/optional_wandb.py
- Command line
-
hf download hf://Elastic-forcing/Elastic-forcing-code/1.3B/code/utils/optional_wandb.py
-
curl -L -o optional_wandb.py https://huggingface.co/Elastic-forcing/Elastic-forcing-code/resolve/main/1.3B/code/utils/optional_wandb.py
487 Bytes
| """Use real wandb when installed; allow explicitly disabled training without it.""" | |
| try: | |
| import wandb as wandb | |
| except ModuleNotFoundError as exc: | |
| if exc.name != "wandb": | |
| raise | |
| class _DisabledWandb: | |
| def finish(*args, **kwargs): | |
| return None | |
| def __getattr__(self, name): | |
| raise RuntimeError( | |
| "wandb is not installed; launch with --disable-wandb" | |
| ) | |
| wandb = _DisabledWandb() | |