# How to load dataset that exist in cache path

**URL:** <https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713>\
**Category:** Beginners\
**Created:** [February 18, 2021, 1:23pm UTC](https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713 "2021-02-18T13:23:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuujhyt](https://avatars.discourse-cdn.com/v4/letter/z/f17d59/32.png) [@zuujhyt](https://discuss.huggingface.co/u/zuujhyt)\
**Post date:** [February 18, 2021, 1:23pm UTC](https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713/1 "2021-02-18T13:23:39Z")

</div>

Hi,  
I try this code in a server with internet connection:

```auto
from datasets import load_dataset
wiki = load_dataset("wikipedia", "20200501.en", split="train")

```

Then automatic downloading process began and there is a folder  
`~/.cache/huggingface/datasets/wikipedia/20200501.en/1.0.0/4021357e28509391eab2f8300d9b689e7e8f3a877ebb3d354b01577d497ebc63/` which contains `wikipedia-train.arrow` and some other files.  
Now I’d like to use the dataset in a server without internet connection.  
What should I do?  
I tried it with

```auto
from datasets import load_from_disk
 wiki = load_from_disk("~/.cache/huggingface/datasets/wikipedia/20200501.en/1.0.0/4021357e28509391eab2f8300d9b689e7e8f3a877ebb3d354b01577d497ebc63"

```

It showed `state.json` not found in that folder.  
Any advice?

---

<div class="post-metadata">

**Author:** ![zuujhyt](https://avatars.discourse-cdn.com/v4/letter/z/f17d59/32.png) [@zuujhyt](https://discuss.huggingface.co/u/zuujhyt)\
**Post date:** [February 18, 2021, 3:27pm UTC](https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713/2 "2021-02-18T15:27:13Z")

</div>

solved it by

```auto
wiki = load_dataset("~/.cache/huggingface/modules/datasets_modules/datasets/wikipedia/4021357e28509391eab2f8300d9b689e7e8f3a877ebb3d354b01577d497ebc63/wikipedia.py", "20200501.en", split="train")

```

---

<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:** [February 19, 2021, 3:04pm UTC](https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713/3 "2021-02-19T15:04:05Z")

</div>

Hi !

Glad you managed to solve your issue 🙂

In the recently released 1.3.0 version of datasets, you should also be able to reload your dataset with no internet connection with

```auto
wiki = load_dataset("wikipedia", "20200501.en", split="train")

```

Indeed if there’s no internet connection, this will fall back on the latest wikipedia dataset that you’ve loaded with `load_dataset`, and notify you with a warning.

In your case it would look for a processed dataset in “~/.cache/huggingface/datasets/wikipedia/20200501.en”

Let me know if you have other questions !

---

<div class="post-metadata">

**Author:** ![zuujhyt](https://avatars.discourse-cdn.com/v4/letter/z/f17d59/32.png) [@zuujhyt](https://discuss.huggingface.co/u/zuujhyt)\
**Post date:** [February 24, 2021, 6:56am UTC](https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713/4 "2021-02-24T06:56:45Z")

</div>

Hi,  
I upgrade to 1.3.0.  
And it indeed works. Thanks!

---

<div class="post-metadata">

**Author:** ![bengisucam](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bengisucam/32/21900_2.png) [@bengisucam](https://discuss.huggingface.co/u/bengisucam)\
**Post date:** [December 6, 2023, 4:25pm UTC](https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713/5 "2023-12-06T16:25:20Z")

</div>

Hi,

I was wondering what happens when the dataset is already cached but the computer has access to the internet and we use load\_dataset() as you did. Will it use from the cache or reload again?

Thank you

---

<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:** [December 6, 2023, 4:44pm UTC](https://discuss.huggingface.co/t/how-to-load-dataset-that-exist-in-cache-path/3713/6 "2023-12-06T16:44:57Z")

</div>

It will reload from cache 🙂

(not super important but there is one bug that will be fixed in the next release: [Datasets created with `push_to_hub` can't be accessed in offline mode · Issue #3547 · huggingface/datasets · GitHub](https://github.com/huggingface/datasets/issues/3547))
