nlp.load_dataset is not safe for multi processes when loading from local files
{'login': 'luyug', 'id': 55288513, 'node_id': 'MDQ6VXNlcjU1Mjg4NTEz', 'avatar_url': 'https://avatars.githubusercontent.com/u/55288513?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/luyug', 'html_url': 'https://github.com/luyug', 'followers_url': 'https://api.github.com/users/luyug/followers', 'following_url': 'https://api.github.com/users/luyug/following{/other_user}', 'gists_url': 'https://api.github.com/users/luyug/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/luyug/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/luyug/subscriptions', 'organizations_url': 'https://api.github.com/users/luyug/orgs', 'repos_url': 'https://api.github.com/users/luyug/repos', 'events_url': 'https://api.github.com/users/luyug/events{/privacy}', 'received_events_url': 'https://api.github.com/users/luyug/received_events', 'type': 'User', 'site_admin': False}
[]
[]
I'll take a look!
Loading from local files, e.g., `dataset = nlp.load_dataset('csv', data_files=['file_1.csv', 'file_2.csv'])`
concurrently from multiple processes, will raise `FileExistsError` from builder's line 430, https://github.com/huggingface/nlp/blob/6655008c738cb613c522deb3bd18e35a67b2a7e5/src/nlp/builder.py#L423-L438

Likely because multiple processes step into download_and_prepare, https://github.com/huggingface/nlp/blob/6655008c738cb613c522deb3bd18e35a67b2a7e5/src/nlp/load.py#L550-L554

This can happen when launching distributed training with commands like `python -m torch.distributed.launch --nproc_per_node 4` on a new collection of files never loaded before.

I can create a PR that puts in some file locks. It would be helpful if I can be informed of the convention for naming and placement of the lock.
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/543/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}