Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit ed9673c

Browse files
authored
[Cherry Pick] [Fix] Add more verbosewandb import error (#1375)
* clean cherry pick * new solution * final fix
1 parent 22d40a3 commit ed9673c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sparseml/pytorch/utils/logger.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,14 @@ def __init__(
534534
init_kwargs: Optional[Dict] = None,
535535
name: str = "wandb",
536536
enabled: bool = True,
537+
wandb_err: Optional[Exception] = wandb_err,
537538
):
539+
if wandb_err:
540+
raise ModuleNotFoundError(
541+
"Error: Failed to import wandb. "
542+
"Please install the wandb library in order to use it."
543+
) from wandb_err
544+
538545
super().__init__(
539546
lambda_func=self._log_lambda,
540547
name=name,

0 commit comments

Comments
 (0)