# Loading downloaded dataset from local directory

**URL:** <https://discuss.huggingface.co/t/loading-downloaded-dataset-from-local-directory/82763>\
**Category:** 🤗Datasets\
**Created:** [April 20, 2024, 9:44am UTC](https://discuss.huggingface.co/t/loading-downloaded-dataset-from-local-directory/82763 "2024-04-20T09:44:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjanette98](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@anjanette98](https://discuss.huggingface.co/u/anjanette98)\
**Post date:** [April 20, 2024, 9:44am UTC](https://discuss.huggingface.co/t/loading-downloaded-dataset-from-local-directory/82763/1 "2024-04-20T09:44:00Z")

</div>

Hi,  
I have my main.py file which downloads a specific object from ShapeNetCore dataset if the download doesnt exist already in my local specified directory.  
The problem that I have is that once I have it downloaded how do I load it from my local directory instead of downloading from huggingface?

```auto
dataset_dir = 'downloaded_data'

if os.path.exists(dataset_dir):
    #Load from existing directory
    dataset = load_dataset("ShapeNet/ShapeNetCore", data_dir=dataset_dir)
    print("dataset loaded from local: ", dataset_dir)
else:
    # Download the dataset from hugging face
    dataset = load_dataset("ShapeNet/ShapeNetCore", data_files="02843684.zip", cache_dir=dataset_dir, download_mode="force_redownload")
    print("Dataset downloaded from hugging face and saved to: ", dataset_dir)
# Print information about the downloaded dataset
print(dataset)

```

When the ShapeNetCore Dataset gets downloaded it is saved in this structure:

 ![Screenshot 2024-04-20 104313](https://us1.discourse-cdn.com/hellohellohello/original/3X/f/e/fea498b1f8dbcba7dc527ea183510fe8269263fd.jpeg)  
How should I fill out the arguments of load\_dataset when wanting to use the already downloaded dataset?  
Thank you
