map only on one process (#13810)
This commit is contained in:
committed by
GitHub
parent
9a9805fccf
commit
44eb8bdeea
@@ -330,12 +330,13 @@ def main():
|
||||
result["labels"] = examples["label"]
|
||||
return result
|
||||
|
||||
processed_datasets = raw_datasets.map(
|
||||
preprocess_function,
|
||||
batched=True,
|
||||
remove_columns=raw_datasets["train"].column_names,
|
||||
desc="Running tokenizer on dataset",
|
||||
)
|
||||
with accelerator.main_process_first():
|
||||
processed_datasets = raw_datasets.map(
|
||||
preprocess_function,
|
||||
batched=True,
|
||||
remove_columns=raw_datasets["train"].column_names,
|
||||
desc="Running tokenizer on dataset",
|
||||
)
|
||||
|
||||
train_dataset = processed_datasets["train"]
|
||||
eval_dataset = processed_datasets["validation_matched" if args.task_name == "mnli" else "validation"]
|
||||
|
||||
Reference in New Issue
Block a user