"docs/source/vscode:/vscode.git/clone" did not exist on "5c8f6010071a02fc80d9862cda717288e23c3a69"
Unverified Commit e73a97a2 authored by Locke's avatar Locke Committed by GitHub
Browse files

add preprocessing_num_workers to run_classification.py (#31586)

preprocessing_num_workers option to speedup preprocess
parent fc689d75
......@@ -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(
default=False, metadata={"help": "Overwrite the cached preprocessed datasets or not."}
)
......@@ -573,6 +577,7 @@ def main():
raw_datasets = raw_datasets.map(
preprocess_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
load_from_cache_file=not data_args.overwrite_cache,
desc="Running tokenizer on dataset",
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment