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
aae4edb5
Commit
aae4edb5
authored
Sep 21, 2020
by
Lysandre
Browse files
Addressing review comment
parent
43b9d938
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/text-classification/run_glue.py
examples/text-classification/run_glue.py
+1
-1
No files found.
examples/text-classification/run_glue.py
View file @
aae4edb5
...
...
@@ -150,7 +150,7 @@ def main():
def
build_compute_metrics_fn
(
task_name
:
str
)
->
Callable
[[
EvalPrediction
],
Dict
]:
def
compute_metrics_fn
(
p
:
EvalPrediction
):
preds
=
p
.
predictions
[
0
]
if
typ
e
(
p
.
predictions
)
==
tuple
else
p
.
predictions
preds
=
p
.
predictions
[
0
]
if
isinstanc
e
(
p
.
predictions
,
tuple
)
else
p
.
predictions
if
output_mode
==
"classification"
:
preds
=
np
.
argmax
(
preds
,
axis
=
1
)
else
:
# regression
...
...
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