# Load\_dataset hangs with local files

**URL:** <https://discuss.huggingface.co/t/load-dataset-hangs-with-local-files/28034>\
**Category:** 🤗Datasets\
**Created:** [December 17, 2022, 7:11pm UTC](https://discuss.huggingface.co/t/load-dataset-hangs-with-local-files/28034 "2022-12-17T19:11:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [January 3, 2023, 11:11am UTC](https://discuss.huggingface.co/t/load-dataset-hangs-with-local-files/28034/4 "2023-01-03T11:11:43Z")

</div>

The code fails when multiprocessing is called. I suspect this is because you didn’t use

```python
if __name__ == " __main__":

```

in your script. Therefore the subprocess would re-run your script and call `load_dataset` in the subprocess again.

---

_[View the full topic](https://discuss.huggingface.co/t/load-dataset-hangs-with-local-files/28034)._
