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
5bc779ae
Unverified
Commit
5bc779ae
authored
Jun 23, 2022
by
Yih-Dar
Committed by
GitHub
Jun 23, 2022
Browse files
Fix an error message in BigBird (#17840)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
3eed5530
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/big_bird/modeling_big_bird.py
src/transformers/models/big_bird/modeling_big_bird.py
+1
-1
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
...ormers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
+1
-1
No files found.
src/transformers/models/big_bird/modeling_big_bird.py
View file @
5bc779ae
...
@@ -972,7 +972,7 @@ class BigBirdBlockSparseAttention(nn.Module):
...
@@ -972,7 +972,7 @@ class BigBirdBlockSparseAttention(nn.Module):
if
params
.
shape
[:
2
]
!=
indices
.
shape
[:
2
]:
if
params
.
shape
[:
2
]
!=
indices
.
shape
[:
2
]:
raise
ValueError
(
raise
ValueError
(
"Make sure that the first two dimensions of params and indices are identical, but"
"Make sure that the first two dimensions of params and indices are identical, but"
f
" they are params:
{
params
.
shape
[:
2
]
}
vs. indices:
{
param
s
.
shape
[:
2
]
}
"
f
" they are params:
{
params
.
shape
[:
2
]
}
vs. indices:
{
indice
s
.
shape
[:
2
]
}
"
)
)
num_indices_to_gather
=
indices
.
shape
[
-
2
]
*
indices
.
shape
[
-
1
]
num_indices_to_gather
=
indices
.
shape
[
-
2
]
*
indices
.
shape
[
-
1
]
num_indices_to_pick_from
=
params
.
shape
[
2
]
num_indices_to_pick_from
=
params
.
shape
[
2
]
...
...
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
View file @
5bc779ae
...
@@ -798,7 +798,7 @@ class BigBirdPegasusBlockSparseAttention(nn.Module):
...
@@ -798,7 +798,7 @@ class BigBirdPegasusBlockSparseAttention(nn.Module):
if
params
.
shape
[:
2
]
!=
indices
.
shape
[:
2
]:
if
params
.
shape
[:
2
]
!=
indices
.
shape
[:
2
]:
raise
ValueError
(
raise
ValueError
(
"Make sure that the first two dimensions of params and indices are identical, but"
"Make sure that the first two dimensions of params and indices are identical, but"
f
" they are params:
{
params
.
shape
[:
2
]
}
vs. indices:
{
param
s
.
shape
[:
2
]
}
"
f
" they are params:
{
params
.
shape
[:
2
]
}
vs. indices:
{
indice
s
.
shape
[:
2
]
}
"
)
)
num_indices_to_gather
=
indices
.
shape
[
-
2
]
*
indices
.
shape
[
-
1
]
num_indices_to_gather
=
indices
.
shape
[
-
2
]
*
indices
.
shape
[
-
1
]
num_indices_to_pick_from
=
params
.
shape
[
2
]
num_indices_to_pick_from
=
params
.
shape
[
2
]
...
...
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