Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
16271080
Unverified
Commit
16271080
authored
Jul 30, 2024
by
Sai-Suraj-27
Committed by
GitHub
Jul 30, 2024
Browse files
fix: Added missing raise keyword for few exceptions (#32333)
Fixed raising of few exceptions.
parent
bd54ed2e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
examples/research_projects/movement-pruning/masked_run_glue.py
...les/research_projects/movement-pruning/masked_run_glue.py
+1
-1
examples/research_projects/movement-pruning/masked_run_squad.py
...es/research_projects/movement-pruning/masked_run_squad.py
+1
-1
src/transformers/integrations/integration_utils.py
src/transformers/integrations/integration_utils.py
+1
-1
No files found.
examples/research_projects/movement-pruning/masked_run_glue.py
View file @
16271080
...
...
@@ -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
...
...
examples/research_projects/movement-pruning/masked_run_squad.py
View file @
16271080
...
...
@@ -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
...
...
src/transformers/integrations/integration_utils.py
View file @
16271080
...
...
@@ -744,7 +744,7 @@ class WandbLogModel(str, Enum):
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."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment