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
87dd1a00
"examples/flax/vscode:/vscode.git/clone" did not exist on "1a77f07f6556b1482bd5e5f8399aa528727d1b47"
Unverified
Commit
87dd1a00
authored
May 03, 2021
by
Sylvain Gugger
Committed by
GitHub
May 03, 2021
Browse files
Fix metric computation in `run_glue_no_trainer` (#11569)
parent
a721a5ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/pytorch/text-classification/run_glue_no_trainer.py
examples/pytorch/text-classification/run_glue_no_trainer.py
+1
-1
No files found.
examples/pytorch/text-classification/run_glue_no_trainer.py
View file @
87dd1a00
...
...
@@ -404,7 +404,7 @@ def main():
model
.
eval
()
for
step
,
batch
in
enumerate
(
eval_dataloader
):
outputs
=
model
(
**
batch
)
predictions
=
outputs
.
logits
.
argmax
(
dim
=-
1
)
predictions
=
outputs
.
logits
.
argmax
(
dim
=-
1
)
if
not
is_regression
else
outputs
.
logits
.
squeeze
()
metric
.
add_batch
(
predictions
=
accelerator
.
gather
(
predictions
),
references
=
accelerator
.
gather
(
batch
[
"labels"
]),
...
...
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