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
9fb7addd
Commit
9fb7addd
authored
Dec 24, 2019
by
James Noeckel
Browse files
revert erroneous fix
parent
81db12c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+1
-3
No files found.
src/transformers/modeling_utils.py
View file @
9fb7addd
...
@@ -958,9 +958,7 @@ def top_k_top_p_filtering(logits, top_k=0, top_p=1.0, filter_value=-float("Inf")
...
@@ -958,9 +958,7 @@ def top_k_top_p_filtering(logits, top_k=0, top_p=1.0, filter_value=-float("Inf")
sorted_indices_to_remove
[...,
0
]
=
0
sorted_indices_to_remove
[...,
0
]
=
0
# scatter sorted tensors to original indexing
# scatter sorted tensors to original indexing
indices_to_remove
=
sorted_indices_to_remove
.
scatter
(
indices_to_remove
=
sorted_indices_to_remove
.
scatter
(
dim
=
1
,
index
=
sorted_indices
,
src
=
sorted_indices_to_remove
)
dim
=
1
,
index
=
sorted_indices
,
source
=
sorted_indices_to_remove
)
logits
[
indices_to_remove
]
=
filter_value
logits
[
indices_to_remove
]
=
filter_value
return
logits
return
logits
...
...
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