# How to load local dataset

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-local-dataset%2F37403%3E%5C
**Category:** 🤗Datasets\
**Created:** [April 22, 2023, 3:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-local-dataset%2F37403 "2023-04-22T03:02:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unrealMJ](https://avatars.discourse-cdn.com/v4/letter/u/c89c15/32.png) [@unrealMJ](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FunrealMJ)%5C
**Post date:** [April 22, 2023, 3:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-local-dataset%2F37403%2F1 "2023-04-22T03:02:32Z")

</div>

Hi

since my ubuntu machine can’t connect to huggingface, i have to load the dataset (Fill50K) locally. I first run the `git clone https://huggingface.co/datasets/fusing/fill50k` on my PC, then i upload it to my ubuntu machine and unzip the images. It has the following directory structure:

- fill50k
  - fill50k.py
  - images
  - conditioning\_images
  - train.jsonl
  - images.zip
  - conditioning\_images.zip

I modify the **\_split\_generators** in **fill50k.py**

```python
# METADATA_URL = hf_hub_url(
# "fusing/fill50k",
# filename="train.jsonl",
# repo_type="dataset",
# )

# IMAGES_URL = hf_hub_url(
# "fusing/fill50k",
# filename="images.zip",
# repo_type="dataset",
# )

# CONDITIONING_IMAGES_URL = hf_hub_url(
# "fusing/fill50k",
# filename="conditioning_images.zip",
# repo_type="dataset",
# )

def _split_generators(self, dl_manager):
        # metadata_path = dl_manager.download(METADATA_URL)
        # images_dir = dl_manager.download_and_extract(IMAGES_URL)
        # conditioning_images_dir = dl_manager.download_and_extract(
        # CONDITIONING_IMAGES_URL
        # )

        metadata_path = './train.jsonl'
        images_dir = './images'
        conditioning_images_dir = './conditioning_images'

        return [
            datasets.SplitGenerator(
                name=datasets.Split.TRAIN,
                # These kwargs will be passed to _generate_examples
                gen_kwargs={
                    "metadata_path": metadata_path,
                    "images_dir": images_dir,
                    "conditioning_images_dir": conditioning_images_dir,
                },
            ),
        ]

```

but when i run `dataset = load_dataset('./fill50k')`, it still download the files.

```python
from datasets import load_dataset
dataset = load_dataset('./fill50k')

---------------------
No config specified, defaulting to: fill50k/default
Downloading and preparing dataset fill50k/default to /home/xxx/.cache/huggingface/datasets/fill50k/default

```

I want to know how to solve this, thanks.

---

<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:** [May 2, 2023, 12:42pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-local-dataset%2F37403%2F2 "2023-05-02T12:42:17Z")

</div>

What makes you think it downloads files ?

Note that the “Downloading and preparing dataset…” message is generic, and is shown even if there is no file to download
