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
f0107862
Unverified
Commit
f0107862
authored
Apr 15, 2024
by
JINO ROHIT
Committed by
GitHub
Apr 15, 2024
Browse files
Set pad_token in run_glue_no_trainer.py #28534 (#30234)
parent
06b11927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
examples/pytorch/text-classification/run_glue_no_trainer.py
examples/pytorch/text-classification/run_glue_no_trainer.py
+3
-0
No files found.
examples/pytorch/text-classification/run_glue_no_trainer.py
View file @
f0107862
...
@@ -327,6 +327,9 @@ def main():
...
@@ -327,6 +327,9 @@ def main():
tokenizer
=
AutoTokenizer
.
from_pretrained
(
tokenizer
=
AutoTokenizer
.
from_pretrained
(
args
.
model_name_or_path
,
use_fast
=
not
args
.
use_slow_tokenizer
,
trust_remote_code
=
args
.
trust_remote_code
args
.
model_name_or_path
,
use_fast
=
not
args
.
use_slow_tokenizer
,
trust_remote_code
=
args
.
trust_remote_code
)
)
if
tokenizer
.
pad_token
is
None
:
tokenizer
.
pad_token
=
tokenizer
.
eos_token
config
.
pad_token_id
=
tokenizer
.
pad_token_id
model
=
AutoModelForSequenceClassification
.
from_pretrained
(
model
=
AutoModelForSequenceClassification
.
from_pretrained
(
args
.
model_name_or_path
,
args
.
model_name_or_path
,
from_tf
=
bool
(
".ckpt"
in
args
.
model_name_or_path
),
from_tf
=
bool
(
".ckpt"
in
args
.
model_name_or_path
),
...
...
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