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
40ea9ab2
Unverified
Commit
40ea9ab2
authored
Oct 12, 2023
by
Tom Aarsen
Committed by
GitHub
Oct 12, 2023
Browse files
Add many missing spaces in adjacent strings (#26751)
Add missing spaces in adjacent strings
parent
3bc65505
Changes
154
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
41 additions
and
41 deletions
+41
-41
examples/flax/image-captioning/create_model_from_encoder_decoder_models.py
...ge-captioning/create_model_from_encoder_decoder_models.py
+2
-2
examples/flax/image-captioning/run_image_captioning_flax.py
examples/flax/image-captioning/run_image_captioning_flax.py
+4
-4
examples/flax/language-modeling/run_bart_dlm_flax.py
examples/flax/language-modeling/run_bart_dlm_flax.py
+2
-2
examples/flax/language-modeling/run_clm_flax.py
examples/flax/language-modeling/run_clm_flax.py
+4
-4
examples/flax/language-modeling/run_mlm_flax.py
examples/flax/language-modeling/run_mlm_flax.py
+3
-3
examples/flax/language-modeling/run_t5_mlm_flax.py
examples/flax/language-modeling/run_t5_mlm_flax.py
+2
-2
examples/flax/question-answering/run_qa.py
examples/flax/question-answering/run_qa.py
+2
-2
examples/flax/speech-recognition/run_flax_speech_recognition_seq2seq.py
...speech-recognition/run_flax_speech_recognition_seq2seq.py
+1
-1
examples/flax/summarization/run_summarization_flax.py
examples/flax/summarization/run_summarization_flax.py
+4
-4
examples/flax/text-classification/run_flax_glue.py
examples/flax/text-classification/run_flax_glue.py
+1
-1
examples/flax/token-classification/run_flax_ner.py
examples/flax/token-classification/run_flax_ner.py
+1
-1
examples/flax/vision/run_image_classification.py
examples/flax/vision/run_image_classification.py
+2
-2
examples/legacy/multiple_choice/utils_multiple_choice.py
examples/legacy/multiple_choice/utils_multiple_choice.py
+2
-2
examples/legacy/pytorch-lightning/lightning_base.py
examples/legacy/pytorch-lightning/lightning_base.py
+1
-1
examples/legacy/question-answering/run_squad.py
examples/legacy/question-answering/run_squad.py
+1
-1
examples/legacy/run_language_modeling.py
examples/legacy/run_language_modeling.py
+2
-2
examples/legacy/run_swag.py
examples/legacy/run_swag.py
+1
-1
examples/pytorch/audio-classification/run_audio_classification.py
.../pytorch/audio-classification/run_audio_classification.py
+3
-3
examples/pytorch/contrastive-image-text/run_clip.py
examples/pytorch/contrastive-image-text/run_clip.py
+2
-2
examples/pytorch/image-classification/run_image_classification.py
.../pytorch/image-classification/run_image_classification.py
+1
-1
No files found.
examples/flax/image-captioning/create_model_from_encoder_decoder_models.py
View file @
40ea9ab2
...
@@ -37,7 +37,7 @@ class ModelArguments:
...
@@ -37,7 +37,7 @@ class ModelArguments:
encoder_model_name_or_path
:
str
=
field
(
encoder_model_name_or_path
:
str
=
field
(
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"The encoder model checkpoint for weights initialization."
"The encoder model checkpoint for weights initialization.
"
"Don't set if you want to train an encoder model from scratch."
"Don't set if you want to train an encoder model from scratch."
)
)
},
},
...
@@ -45,7 +45,7 @@ class ModelArguments:
...
@@ -45,7 +45,7 @@ class ModelArguments:
decoder_model_name_or_path
:
str
=
field
(
decoder_model_name_or_path
:
str
=
field
(
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"The decoder model checkpoint for weights initialization."
"The decoder model checkpoint for weights initialization.
"
"Don't set if you want to train a decoder model from scratch."
"Don't set if you want to train a decoder model from scratch."
)
)
},
},
...
...
examples/flax/image-captioning/run_image_captioning_flax.py
View file @
40ea9ab2
...
@@ -203,7 +203,7 @@ class ModelArguments:
...
@@ -203,7 +203,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -256,7 +256,7 @@ class DataTrainingArguments:
...
@@ -256,7 +256,7 @@ class DataTrainingArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"The maximum total sequence length for validation target text after tokenization. Sequences longer "
"The maximum total sequence length for validation target text after tokenization. Sequences longer "
"than this will be truncated, sequences shorter will be padded. Will default to `max_target_length`."
"than this will be truncated, sequences shorter will be padded. Will default to `max_target_length`.
"
"This argument is also used to override the `max_length` param of `model.generate`, which is used "
"This argument is also used to override the `max_length` param of `model.generate`, which is used "
"during evaluation."
"during evaluation."
)
)
...
@@ -423,7 +423,7 @@ def main():
...
@@ -423,7 +423,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use --overwrite_output_dir to overcome."
"Use --overwrite_output_dir to overcome."
)
)
...
@@ -685,7 +685,7 @@ def main():
...
@@ -685,7 +685,7 @@ def main():
eval_batch_size
=
int
(
training_args
.
per_device_eval_batch_size
)
*
jax
.
device_count
()
eval_batch_size
=
int
(
training_args
.
per_device_eval_batch_size
)
*
jax
.
device_count
()
if
training_args
.
block_size
%
train_batch_size
>
0
or
training_args
.
block_size
%
eval_batch_size
>
0
:
if
training_args
.
block_size
%
train_batch_size
>
0
or
training_args
.
block_size
%
eval_batch_size
>
0
:
raise
ValueError
(
raise
ValueError
(
"`training_args.block_size` needs to be a multiple of the global train/eval batch size."
"`training_args.block_size` needs to be a multiple of the global train/eval batch size.
"
f
"Got
{
training_args
.
block_size
}
,
{
train_batch_size
}
and
{
eval_batch_size
}
respectively instead."
f
"Got
{
training_args
.
block_size
}
,
{
train_batch_size
}
and
{
eval_batch_size
}
respectively instead."
)
)
...
...
examples/flax/language-modeling/run_bart_dlm_flax.py
View file @
40ea9ab2
...
@@ -487,7 +487,7 @@ def main():
...
@@ -487,7 +487,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use --overwrite_output_dir to overcome."
"Use --overwrite_output_dir to overcome."
)
)
...
@@ -606,7 +606,7 @@ def main():
...
@@ -606,7 +606,7 @@ def main():
)
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
"You are instantiating a new tokenizer from scratch. This is not supported by this script."
"You are instantiating a new tokenizer from scratch. This is not supported by this script.
"
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
)
)
...
...
examples/flax/language-modeling/run_clm_flax.py
View file @
40ea9ab2
...
@@ -190,7 +190,7 @@ class ModelArguments:
...
@@ -190,7 +190,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -368,7 +368,7 @@ def main():
...
@@ -368,7 +368,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use --overwrite_output_dir to overcome."
"Use --overwrite_output_dir to overcome."
)
)
...
@@ -524,7 +524,7 @@ def main():
...
@@ -524,7 +524,7 @@ def main():
)
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
"You are instantiating a new tokenizer from scratch. This is not supported by this script."
"You are instantiating a new tokenizer from scratch. This is not supported by this script.
"
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
)
)
...
@@ -586,7 +586,7 @@ def main():
...
@@ -586,7 +586,7 @@ def main():
else
:
else
:
if
data_args
.
block_size
>
tokenizer
.
model_max_length
:
if
data_args
.
block_size
>
tokenizer
.
model_max_length
:
logger
.
warning
(
logger
.
warning
(
f
"The block_size passed (
{
data_args
.
block_size
}
) is larger than the maximum length for the model"
f
"The block_size passed (
{
data_args
.
block_size
}
) is larger than the maximum length for the model
"
f
"(
{
tokenizer
.
model_max_length
}
). Using block_size=
{
tokenizer
.
model_max_length
}
."
f
"(
{
tokenizer
.
model_max_length
}
). Using block_size=
{
tokenizer
.
model_max_length
}
."
)
)
block_size
=
min
(
data_args
.
block_size
,
tokenizer
.
model_max_length
)
block_size
=
min
(
data_args
.
block_size
,
tokenizer
.
model_max_length
)
...
...
examples/flax/language-modeling/run_mlm_flax.py
View file @
40ea9ab2
...
@@ -195,7 +195,7 @@ class ModelArguments:
...
@@ -195,7 +195,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -411,7 +411,7 @@ def main():
...
@@ -411,7 +411,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use --overwrite_output_dir to overcome."
"Use --overwrite_output_dir to overcome."
)
)
...
@@ -556,7 +556,7 @@ def main():
...
@@ -556,7 +556,7 @@ def main():
)
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
"You are instantiating a new tokenizer from scratch. This is not supported by this script."
"You are instantiating a new tokenizer from scratch. This is not supported by this script.
"
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
)
)
...
...
examples/flax/language-modeling/run_t5_mlm_flax.py
View file @
40ea9ab2
...
@@ -528,7 +528,7 @@ def main():
...
@@ -528,7 +528,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use --overwrite_output_dir to overcome."
"Use --overwrite_output_dir to overcome."
)
)
...
@@ -647,7 +647,7 @@ def main():
...
@@ -647,7 +647,7 @@ def main():
)
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
"You are instantiating a new tokenizer from scratch. This is not supported by this script."
"You are instantiating a new tokenizer from scratch. This is not supported by this script.
"
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
)
)
...
...
examples/flax/question-answering/run_qa.py
View file @
40ea9ab2
...
@@ -176,7 +176,7 @@ class ModelArguments:
...
@@ -176,7 +176,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -582,7 +582,7 @@ def main():
...
@@ -582,7 +582,7 @@ def main():
if
data_args
.
max_seq_length
>
tokenizer
.
model_max_length
:
if
data_args
.
max_seq_length
>
tokenizer
.
model_max_length
:
logger
.
warning
(
logger
.
warning
(
f
"The max_seq_length passed (
{
data_args
.
max_seq_length
}
) is larger than the maximum length for the"
f
"The max_seq_length passed (
{
data_args
.
max_seq_length
}
) is larger than the maximum length for the
"
f
"model (
{
tokenizer
.
model_max_length
}
). Using max_seq_length=
{
tokenizer
.
model_max_length
}
."
f
"model (
{
tokenizer
.
model_max_length
}
). Using max_seq_length=
{
tokenizer
.
model_max_length
}
."
)
)
max_seq_length
=
min
(
data_args
.
max_seq_length
,
tokenizer
.
model_max_length
)
max_seq_length
=
min
(
data_args
.
max_seq_length
,
tokenizer
.
model_max_length
)
...
...
examples/flax/speech-recognition/run_flax_speech_recognition_seq2seq.py
View file @
40ea9ab2
...
@@ -415,7 +415,7 @@ def main():
...
@@ -415,7 +415,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use `--overwrite_output_dir` to overcome."
"Use `--overwrite_output_dir` to overcome."
)
)
...
...
examples/flax/summarization/run_summarization_flax.py
View file @
40ea9ab2
...
@@ -209,7 +209,7 @@ class ModelArguments:
...
@@ -209,7 +209,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -268,7 +268,7 @@ class DataTrainingArguments:
...
@@ -268,7 +268,7 @@ class DataTrainingArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"The maximum total sequence length for validation target text after tokenization. Sequences longer "
"The maximum total sequence length for validation target text after tokenization. Sequences longer "
"than this will be truncated, sequences shorter will be padded. Will default to `max_target_length`."
"than this will be truncated, sequences shorter will be padded. Will default to `max_target_length`.
"
"This argument is also used to override the `max_length` param of `model.generate`, which is used "
"This argument is also used to override the `max_length` param of `model.generate`, which is used "
"during evaluation."
"during evaluation."
)
)
...
@@ -451,7 +451,7 @@ def main():
...
@@ -451,7 +451,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use --overwrite_output_dir to overcome."
"Use --overwrite_output_dir to overcome."
)
)
...
@@ -558,7 +558,7 @@ def main():
...
@@ -558,7 +558,7 @@ def main():
)
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
"You are instantiating a new tokenizer from scratch. This is not supported by this script."
"You are instantiating a new tokenizer from scratch. This is not supported by this script.
"
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
)
)
...
...
examples/flax/text-classification/run_flax_glue.py
View file @
40ea9ab2
...
@@ -122,7 +122,7 @@ class ModelArguments:
...
@@ -122,7 +122,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
...
examples/flax/token-classification/run_flax_ner.py
View file @
40ea9ab2
...
@@ -170,7 +170,7 @@ class ModelArguments:
...
@@ -170,7 +170,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
...
examples/flax/vision/run_image_classification.py
View file @
40ea9ab2
...
@@ -180,7 +180,7 @@ class ModelArguments:
...
@@ -180,7 +180,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -291,7 +291,7 @@ def main():
...
@@ -291,7 +291,7 @@ def main():
and
not
training_args
.
overwrite_output_dir
and
not
training_args
.
overwrite_output_dir
):
):
raise
ValueError
(
raise
ValueError
(
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty."
f
"Output directory (
{
training_args
.
output_dir
}
) already exists and is not empty.
"
"Use --overwrite_output_dir to overcome."
"Use --overwrite_output_dir to overcome."
)
)
...
...
examples/legacy/multiple_choice/utils_multiple_choice.py
View file @
40ea9ab2
...
@@ -379,7 +379,7 @@ class SwagProcessor(DataProcessor):
...
@@ -379,7 +379,7 @@ class SwagProcessor(DataProcessor):
"""See base class."""
"""See base class."""
logger
.
info
(
"LOOKING AT {} dev"
.
format
(
data_dir
))
logger
.
info
(
"LOOKING AT {} dev"
.
format
(
data_dir
))
raise
ValueError
(
raise
ValueError
(
"For swag testing, the input file does not contain a label column. It can not be tested in current code"
"For swag testing, the input file does not contain a label column. It can not be tested in current code
"
"setting!"
"setting!"
)
)
return
self
.
_create_examples
(
self
.
_read_csv
(
os
.
path
.
join
(
data_dir
,
"test.csv"
)),
"test"
)
return
self
.
_create_examples
(
self
.
_read_csv
(
os
.
path
.
join
(
data_dir
,
"test.csv"
)),
"test"
)
...
@@ -541,7 +541,7 @@ def convert_examples_to_features(
...
@@ -541,7 +541,7 @@ def convert_examples_to_features(
if
"num_truncated_tokens"
in
inputs
and
inputs
[
"num_truncated_tokens"
]
>
0
:
if
"num_truncated_tokens"
in
inputs
and
inputs
[
"num_truncated_tokens"
]
>
0
:
logger
.
info
(
logger
.
info
(
"Attention! you are cropping tokens (swag task is ok). "
"Attention! you are cropping tokens (swag task is ok). "
"If you are training ARC and RACE and you are poping question + options,"
"If you are training ARC and RACE and you are poping question + options,
"
"you need to try to use a bigger max seq length!"
"you need to try to use a bigger max seq length!"
)
)
...
...
examples/legacy/pytorch-lightning/lightning_base.py
View file @
40ea9ab2
...
@@ -313,7 +313,7 @@ def add_generic_args(parser, root_dir) -> None:
...
@@ -313,7 +313,7 @@ def add_generic_args(parser, root_dir) -> None:
type
=
str
,
type
=
str
,
default
=
"O2"
,
default
=
"O2"
,
help
=
(
help
=
(
"For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3']."
"For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3'].
"
"See details at https://nvidia.github.io/apex/amp.html"
"See details at https://nvidia.github.io/apex/amp.html"
),
),
)
)
...
...
examples/legacy/question-answering/run_squad.py
View file @
40ea9ab2
...
@@ -663,7 +663,7 @@ def main():
...
@@ -663,7 +663,7 @@ def main():
type
=
str
,
type
=
str
,
default
=
"O1"
,
default
=
"O1"
,
help
=
(
help
=
(
"For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3']."
"For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3'].
"
"See details at https://nvidia.github.io/apex/amp.html"
"See details at https://nvidia.github.io/apex/amp.html"
),
),
)
)
...
...
examples/legacy/run_language_modeling.py
View file @
40ea9ab2
...
@@ -149,7 +149,7 @@ class DataTrainingArguments:
...
@@ -149,7 +149,7 @@ class DataTrainingArguments:
default
=-
1
,
default
=-
1
,
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Optional input sequence length after tokenization."
"Optional input sequence length after tokenization.
"
"The training dataset will be truncated in block of this size for training."
"The training dataset will be truncated in block of this size for training."
"Default to the model max input length for single sentence inputs (take into account special tokens)."
"Default to the model max input length for single sentence inputs (take into account special tokens)."
)
)
...
@@ -283,7 +283,7 @@ def main():
...
@@ -283,7 +283,7 @@ def main():
if
config
.
model_type
in
[
"bert"
,
"roberta"
,
"distilbert"
,
"camembert"
]
and
not
data_args
.
mlm
:
if
config
.
model_type
in
[
"bert"
,
"roberta"
,
"distilbert"
,
"camembert"
]
and
not
data_args
.
mlm
:
raise
ValueError
(
raise
ValueError
(
"BERT and RoBERTa-like models do not have LM heads but masked LM heads. They must be run using the"
"BERT and RoBERTa-like models do not have LM heads but masked LM heads. They must be run using the
"
"--mlm flag (masked language modeling)."
"--mlm flag (masked language modeling)."
)
)
...
...
examples/legacy/run_swag.py
View file @
40ea9ab2
...
@@ -579,7 +579,7 @@ def main():
...
@@ -579,7 +579,7 @@ def main():
type
=
str
,
type
=
str
,
default
=
"O1"
,
default
=
"O1"
,
help
=
(
help
=
(
"For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3']."
"For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3'].
"
"See details at https://nvidia.github.io/apex/amp.html"
"See details at https://nvidia.github.io/apex/amp.html"
),
),
)
)
...
...
examples/pytorch/audio-classification/run_audio_classification.py
View file @
40ea9ab2
...
@@ -172,7 +172,7 @@ class ModelArguments:
...
@@ -172,7 +172,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -189,14 +189,14 @@ class ModelArguments:
...
@@ -189,14 +189,14 @@ class ModelArguments:
if
not
self
.
freeze_feature_extractor
and
self
.
freeze_feature_encoder
:
if
not
self
.
freeze_feature_extractor
and
self
.
freeze_feature_encoder
:
warnings
.
warn
(
warnings
.
warn
(
"The argument `--freeze_feature_extractor` is deprecated and "
"The argument `--freeze_feature_extractor` is deprecated and "
"will be removed in a future version. Use `--freeze_feature_encoder`"
"will be removed in a future version. Use `--freeze_feature_encoder`
"
"instead. Setting `freeze_feature_encoder==True`."
,
"instead. Setting `freeze_feature_encoder==True`."
,
FutureWarning
,
FutureWarning
,
)
)
if
self
.
freeze_feature_extractor
and
not
self
.
freeze_feature_encoder
:
if
self
.
freeze_feature_extractor
and
not
self
.
freeze_feature_encoder
:
raise
ValueError
(
raise
ValueError
(
"The argument `--freeze_feature_extractor` is deprecated and "
"The argument `--freeze_feature_extractor` is deprecated and "
"should not be used in combination with `--freeze_feature_encoder`."
"should not be used in combination with `--freeze_feature_encoder`.
"
"Only make use of `--freeze_feature_encoder`."
"Only make use of `--freeze_feature_encoder`."
)
)
...
...
examples/pytorch/contrastive-image-text/run_clip.py
View file @
40ea9ab2
...
@@ -107,7 +107,7 @@ class ModelArguments:
...
@@ -107,7 +107,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
@@ -358,7 +358,7 @@ def main():
...
@@ -358,7 +358,7 @@ def main():
)
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
"You are instantiating a new tokenizer from scratch. This is not supported by this script."
"You are instantiating a new tokenizer from scratch. This is not supported by this script.
"
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
)
)
...
...
examples/pytorch/image-classification/run_image_classification.py
View file @
40ea9ab2
...
@@ -163,7 +163,7 @@ class ModelArguments:
...
@@ -163,7 +163,7 @@ class ModelArguments:
metadata
=
{
metadata
=
{
"help"
:
(
"help"
:
(
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
"should only be set to `True` for repositories you trust and in which you have read the code, as it will
"
"execute code present on the Hub on your local machine."
"execute code present on the Hub on your local machine."
)
)
},
},
...
...
Prev
1
2
3
4
5
…
8
Next
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