Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
e73a97a2
Unverified
Commit
e73a97a2
authored
Jun 25, 2024
by
Locke
Committed by
GitHub
Jun 25, 2024
Browse files
add preprocessing_num_workers to run_classification.py (#31586)
preprocessing_num_workers option to speedup preprocess
parent
fc689d75
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
examples/pytorch/text-classification/run_classification.py
examples/pytorch/text-classification/run_classification.py
+5
-0
No files found.
examples/pytorch/text-classification/run_classification.py
View file @
e73a97a2
...
@@ -133,6 +133,10 @@ class DataTrainingArguments:
...
@@ -133,6 +133,10 @@ class DataTrainingArguments:
)
)
},
},
)
)
preprocessing_num_workers
:
Optional
[
int
]
=
field
(
default
=
None
,
metadata
=
{
"help"
:
"The number of processes to use for the preprocessing."
},
)
overwrite_cache
:
bool
=
field
(
overwrite_cache
:
bool
=
field
(
default
=
False
,
metadata
=
{
"help"
:
"Overwrite the cached preprocessed datasets or not."
}
default
=
False
,
metadata
=
{
"help"
:
"Overwrite the cached preprocessed datasets or not."
}
)
)
...
@@ -573,6 +577,7 @@ def main():
...
@@ -573,6 +577,7 @@ def main():
raw_datasets
=
raw_datasets
.
map
(
raw_datasets
=
raw_datasets
.
map
(
preprocess_function
,
preprocess_function
,
batched
=
True
,
batched
=
True
,
num_proc
=
data_args
.
preprocessing_num_workers
,
load_from_cache_file
=
not
data_args
.
overwrite_cache
,
load_from_cache_file
=
not
data_args
.
overwrite_cache
,
desc
=
"Running tokenizer on dataset"
,
desc
=
"Running tokenizer on dataset"
,
)
)
...
...
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