File size: 487 Bytes
2ea2835
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""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:
        @staticmethod
        def finish(*args, **kwargs):
            return None

        def __getattr__(self, name):
            raise RuntimeError(
                "wandb is not installed; launch with --disable-wandb"
            )

    wandb = _DisabledWandb()