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
7af7d7ce
Unverified
Commit
7af7d7ce
authored
Oct 06, 2021
by
Siarhei Melnik
Committed by
GitHub
Oct 05, 2021
Browse files
fix: replace asserts by error (#13894)
parent
f099249c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/models/distilbert/modeling_flax_distilbert.py
...ransformers/models/distilbert/modeling_flax_distilbert.py
+2
-1
No files found.
src/transformers/models/distilbert/modeling_flax_distilbert.py
View file @
7af7d7ce
...
...
@@ -172,7 +172,8 @@ class FlaxMultiHeadSelfAttention(nn.Module):
self
.
dim
=
self
.
config
.
dim
self
.
dropout
=
nn
.
Dropout
(
rate
=
self
.
config
.
attention_dropout
)
assert
self
.
dim
%
self
.
n_heads
==
0
,
f
"Hidden size
{
self
.
dim
}
not dividable by number of heads
{
self
.
n_heads
}
"
if
not
(
self
.
dim
%
self
.
n_heads
==
0
):
raise
ValueError
(
f
"Hidden size
{
self
.
dim
}
not dividable by number of heads
{
self
.
n_heads
}
"
)
self
.
q_lin
=
nn
.
Dense
(
self
.
dim
,
...
...
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