diff --git a/examples/research_projects/movement-pruning/masked_run_glue.py b/examples/research_projects/movement-pruning/masked_run_glue.py index f7103deca10594..4ddb4248357518 100644 --- a/examples/research_projects/movement-pruning/masked_run_glue.py +++ b/examples/research_projects/movement-pruning/masked_run_glue.py @@ -98,7 +98,7 @@ def regularization(model: nn.Module, mode: str): elif mode == "l0": regu += torch.sigmoid(param - 2 / 3 * np.log(0.1 / 1.1)).sum() / param.numel() else: - ValueError("Don't know this mode.") + raise ValueError("Don't know this mode.") counter += 1 return regu / counter diff --git a/examples/research_projects/movement-pruning/masked_run_squad.py b/examples/research_projects/movement-pruning/masked_run_squad.py index d7b4b191126b55..7b1c2b322097a4 100644 --- a/examples/research_projects/movement-pruning/masked_run_squad.py +++ b/examples/research_projects/movement-pruning/masked_run_squad.py @@ -101,7 +101,7 @@ def regularization(model: nn.Module, mode: str): elif mode == "l0": regu += torch.sigmoid(param - 2 / 3 * np.log(0.1 / 1.1)).sum() / param.numel() else: - ValueError("Don't know this mode.") + raise ValueError("Don't know this mode.") counter += 1 return regu / counter diff --git a/src/transformers/integrations/integration_utils.py b/src/transformers/integrations/integration_utils.py index 52e37b5d7524a5..df4a834b370cb6 100755 --- a/src/transformers/integrations/integration_utils.py +++ b/src/transformers/integrations/integration_utils.py @@ -744,7 +744,7 @@ def _missing_(cls, value: Any) -> "WandbLogModel": if not isinstance(value, str): raise ValueError(f"Expecting to have a string `WANDB_LOG_MODEL` setting, but got {type(value)}") if value.upper() in ENV_VARS_TRUE_VALUES: - DeprecationWarning( + raise DeprecationWarning( f"Setting `WANDB_LOG_MODEL` as {os.getenv('WANDB_LOG_MODEL')} is deprecated and will be removed in " "version 5 of transformers. Use one of `'end'` or `'checkpoint'` instead." )