# How to load a huggingface dataset from local path?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076%3E%5C
**Category:** Beginners\
**Created:** [September 1, 2023, 5:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076 "2023-09-01T05:51:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![4daJ](https://avatars.discourse-cdn.com/v4/letter/4/3d9bf3/32.png) [@4daJ](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2F4daJ)%5C
**Post date:** [September 1, 2023, 5:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076%2F1 "2023-09-01T05:51:11Z")

</div>

Take a simple example in this website, [https://huggingface.co/datasets/Dahoas/rm-static:](https://huggingface.co/datasets/Dahoas/rm-static:)

if I want to load this dataset online, I just directly use,

```
from datasets import load_dataset
dataset = load_dataset("Dahoas/rm-static") 

```

What if I want to load dataset from local path, so I download the files and keep the same folder structure from web `Files and versions` fristly,

```
-data
|-test-00000-of-00001-bf4c733542e35fcb.parquet
|-train-00000-of-00001-2a1df75c6bce91ab.parquet
-.gitattributes
-README.md
-dataset_infos.json

```

Then,put them into my folder, but shows error when loading,

```
dataset_path ="/data/coco/dataset/Dahoas/rm-static"
tmp_dataset = load_dataset(dataset_path)

```

It shows,`FileNotFoundError: No (supported) data files or dataset script found in /data/coco/dataset/Dahoas/rm-static.`

---

<div class="post-metadata">

**Author:** ![vpkprasanna](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/vpkprasanna/32/26436_2.png) [@vpkprasanna](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvpkprasanna)%5C
**Post date:** [September 1, 2023, 6:14am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076%2F2 "2023-09-01T06:14:42Z")

</div>

if you want to load dataset from your local path you should follow the below apporach  
[see the docs](https://huggingface.co/docs/datasets/v1.11.0/package_reference/loading_methods.html#datasets.load_dataset) which will accept a parameter named path where a `py` to process your local file path

---

<div class="post-metadata">

**Author:** ![4daJ](https://avatars.discourse-cdn.com/v4/letter/4/3d9bf3/32.png) [@4daJ](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2F4daJ)%5C
**Post date:** [September 1, 2023, 6:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076%2F3 "2023-09-01T06:24:11Z")

</div>

thanks for your reply, but, for example, there is no .py file in Dahoas/rm-static, and even though i put README.md, gitattributes in “/data/coco/dataset/Dahoas/rm-static”, it sitll shows aboved error

---

<div class="post-metadata">

**Author:** ![4daJ](https://avatars.discourse-cdn.com/v4/letter/4/3d9bf3/32.png) [@4daJ](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2F4daJ)%5C
**Post date:** [September 1, 2023, 6:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076%2F4 "2023-09-01T06:51:08Z")

</div>

I solved this problem,  
data\_files = {“train”:“train-00000-of-00001-2a1df75c6bce91ab.parquet”,“test”:“test-00000-of-00001-8c7c51afc6d45980.parquet”}  
raw\_datasets = load\_dataset(“parquet”, data\_dir=‘/Your/Path/Dahoas/rm-static/data’, data\_files=data\_files)

---

<div class="post-metadata">

**Author:** ![ZilanYu](https://avatars.discourse-cdn.com/v4/letter/z/48db29/32.png) [@ZilanYu](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FZilanYu)%5C
**Post date:** [June 2, 2024, 6:47am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076%2F5 "2024-06-02T06:47:33Z")

</div>

Thank you!!!

---

<div class="post-metadata">

**Author:** ![letao670982](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@letao670982](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fletao670982)%5C
**Post date:** [July 18, 2024, 7:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-a-huggingface-dataset-from-local-path%2F53076%2F6 "2024-07-18T07:09:12Z")

</div>

Good solution! Bro
