Skip to content

Commit 3c169c9

Browse files
authored
Merge pull request #169 from Genentech/fix-wandb
Fix wandb login, set anonymous to must
2 parents 93d9520 + 530e636 commit 3c169c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/grelu/resources/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ def _check_wandb(host:str=DEFAULT_WANDB_HOST) -> None:
8686
Args:
8787
host: URL of the Weights & Biases host
8888
"""
89-
assert wandb.login(host=host, anonymous="allow"), f'Weights & Biases (wandb) is not configured, see {host}/authorize'
89+
try:
90+
wandb.login(host=host, anonymous="allow")
91+
except Exception as _:
92+
try:
93+
wandb.login(host=host, anonymous="must", timeout=0)
94+
except Exception as e:
95+
raise RuntimeError(f'Weights & Biases (wandb) is not configured, see {host}/authorize') from e
9096

9197

9298
def projects(host: str=DEFAULT_WANDB_HOST) -> List[str]:

0 commit comments

Comments
 (0)