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
57a66269
Unverified
Commit
57a66269
authored
Jan 05, 2021
by
Yusuke Mori
Committed by
GitHub
Jan 05, 2021
Browse files
[examples/text-classification] Fix a bug for using one's own dataset of a regression task (#9411)
parent
189387e9
Changes
1
Hide 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 @
57a66269
...
@@ -289,7 +289,7 @@ def main():
...
@@ -289,7 +289,7 @@ def main():
f
"model labels:
{
list
(
sorted
(
label_name_to_id
.
keys
()))
}
, dataset labels:
{
list
(
sorted
(
label_list
))
}
."
f
"model labels:
{
list
(
sorted
(
label_name_to_id
.
keys
()))
}
, dataset labels:
{
list
(
sorted
(
label_list
))
}
."
"
\n
Ignoring the model labels as a result."
,
"
\n
Ignoring the model labels as a result."
,
)
)
elif
data_args
.
task_name
is
None
:
elif
data_args
.
task_name
is
None
and
not
is_regression
:
label_to_id
=
{
v
:
i
for
i
,
v
in
enumerate
(
label_list
)}
label_to_id
=
{
v
:
i
for
i
,
v
in
enumerate
(
label_list
)}
def
preprocess_function
(
examples
):
def
preprocess_function
(
examples
):
...
...
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