# Load\_dataset hangs with local files

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-dataset-hangs-with-local-files%2F28034%3E%5C
**Category:** 🤗Datasets\
**Created:** [December 17, 2022, 7:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-dataset-hangs-with-local-files%2F28034 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flhoestq)%5C
**Post date:** [January 3, 2023, 11:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-dataset-hangs-with-local-files%2F28034%2F4 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-dataset-hangs-with-local-files%2F28034)._
