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
98268b2e
Unverified
Commit
98268b2e
authored
Apr 04, 2023
by
Maziyar Panahi
Committed by
GitHub
Apr 04, 2023
Browse files
Add id2label and label2id to model's config in run_xnil (#22558)
Add id2label and label2id to config in run_xnil
parent
fa2bdffc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
examples/pytorch/text-classification/run_xnli.py
examples/pytorch/text-classification/run_xnli.py
+2
-0
No files found.
examples/pytorch/text-classification/run_xnli.py
View file @
98268b2e
...
...
@@ -273,6 +273,8 @@ def main():
config
=
AutoConfig
.
from_pretrained
(
model_args
.
config_name
if
model_args
.
config_name
else
model_args
.
model_name_or_path
,
num_labels
=
num_labels
,
id2label
=
{
str
(
i
):
label
for
i
,
label
in
enumerate
(
label_list
)},
label2id
=
{
label
:
i
for
i
,
label
in
enumerate
(
label_list
)},
finetuning_task
=
"xnli"
,
cache_dir
=
model_args
.
cache_dir
,
revision
=
model_args
.
model_revision
,
...
...
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