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
62d30e05
"vscode:/vscode.git/clone" did not exist on "93294e61393e349e8ef4caeb3cd3e0e4fad89a10"
Unverified
Commit
62d30e05
authored
Dec 07, 2020
by
Sylvain Gugger
Committed by
GitHub
Dec 07, 2020
Browse files
Small fix to the run clm script (#8973)
parent
28fa014a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
examples/language-modeling/run_clm.py
examples/language-modeling/run_clm.py
+9
-3
No files found.
examples/language-modeling/run_clm.py
View file @
62d30e05
...
...
@@ -102,8 +102,8 @@ class DataTrainingArguments:
default
=
None
,
metadata
=
{
"help"
:
"An optional input evaluation data file to evaluate the perplexity on (a text file)."
},
)
block_size
:
int
=
field
(
default
=
-
1
,
block_size
:
Optional
[
int
]
=
field
(
default
=
None
,
metadata
=
{
"help"
:
"Optional input sequence length after tokenization."
"The training dataset will be truncated in block of this size for training."
...
...
@@ -261,8 +261,14 @@ def main():
load_from_cache_file
=
not
data_args
.
overwrite_cache
,
)
if
data_args
.
block_size
<=
0
:
if
data_args
.
block_size
is
None
:
block_size
=
tokenizer
.
model_max_length
if
block_size
>
1024
:
logger
.
warn
(
f
"The tokenizer picked seems to have a very large `model_max_length` (
{
tokenizer
.
model_max_length
}
). "
"Picking 1024 instead. You can change that default value by passing --block_size xxx."
)
block_size
=
1024
else
:
if
data_args
.
block_size
>
tokenizer
.
model_max_length
:
logger
.
warn
(
...
...
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