# Save and load datasets

**URL:** <https://discuss.huggingface.co/t/save-and-load-datasets/9260>\
**Category:** 🤗Datasets\
**Created:** [August 16, 2021, 5:13am UTC](https://discuss.huggingface.co/t/save-and-load-datasets/9260 "2021-08-16T05:13:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeril](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jeril](https://discuss.huggingface.co/u/jeril)\
**Post date:** [August 16, 2021, 5:13am UTC](https://discuss.huggingface.co/t/save-and-load-datasets/9260/1 "2021-08-16T05:13:15Z")

</div>

My office PC is not connected to internet, and I want to use the datasets package to load the dataset. I first saved the already existing dataset using the following code:

```auto
from datasets import load_dataset
datasets = load_dataset("glue", "mrpc")
datasets.save_to_disk('glue-mrpc')

```

A folder is created with `dataset_dict.json` file and three folders for train, test, and validation respectively. I zipped the folder andcopied to my office PC, and now when i tried loading the dataset from folder using the following code:

```auto
datasets = load_dataset('/content/glue-mrpc')

```

But I am getting the following error:

```auto
FileNotFoundError: Couldn't find file locally at /content/glue-mrpc/glue-mrpc.py. Please provide a valid dataset name.

```

I also tried pickling, but didnt work.

Is there any way to save the dataset in one PC and load it in another PC?  
Thank you.

---

<div class="post-metadata">

**Author:** ![ehalit](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ehalit/32/28854_2.png) [@ehalit](https://discuss.huggingface.co/u/ehalit)\
**Post date:** [August 16, 2021, 6:56am UTC](https://discuss.huggingface.co/t/save-and-load-datasets/9260/2 "2021-08-16T06:56:21Z")

</div>

When loading from a directory created by `save_to_disk` function, try using `load_from_disk` [method](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=load_from_disk#datasets.Dataset.load_from_disk)

---

<div class="post-metadata">

**Author:** ![jeril](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jeril](https://discuss.huggingface.co/u/jeril)\
**Post date:** [August 16, 2021, 9:27am UTC](https://discuss.huggingface.co/t/save-and-load-datasets/9260/3 "2021-08-16T09:27:18Z")

</div>

Thank you so much, it worked.

I should have checked for `dir(datasets)`
