# How to create a dataset script for the LAION dataset

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-dataset-script-for-the-laion-dataset%2F25229%3E%5C
**Category:** 🤗Datasets\
**Created:** [October 30, 2022, 6:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-dataset-script-for-the-laion-dataset%2F25229 "2022-10-30T18:08:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oo92](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/oo92/32/12282_2.png) [@oo92](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Foo92)%5C
**Post date:** [October 30, 2022, 6:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-dataset-script-for-the-laion-dataset%2F25229%2F1 "2022-10-30T18:08:15Z")

</div>

Hi.

I’ve been struggling with this for a while. I came across a notebook that works with the [Pokemon BLIP captions](https://lambdalabs/pokemon-blip-captions) dataset. I have a dataset that has the same format, which is the [LAION Aesthetic 6pls](https://laion-aesthetic.datasette.io/laion-aesthetic-6pls/images).

In the huggingface docs, I got the impression that I’d have to write a dataset script like the one for [Food-101](https://huggingface.co/datasets/food101/blob/main/food101.py) dataset but I couldn’t figure out how to apply this to LAION.

My goal is to upload the LAION dataset to hugginface in the same way Pokemon BLIP captions have. One column of images and the other column of captions.

I don’t know if a dataset script is even necessary for this but I’d like to know how to go about it.

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/64813_2.png) [@lhoestq](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flhoestq)%5C
**Post date:** [November 4, 2022, 3:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-dataset-script-for-the-laion-dataset%2F25229%2F2 "2022-11-04T15:11:06Z")

</div>

Hi ! You can just load your dataset in python this way:

```python
from datasets import load_dataset, Dataset, Image

texts = ["text of img0", "text of img1", ...]
image_paths = ["path_or_url/to/img0.png", "path_or_url/to/img1.png", ...]

ds = Dataset.from_dict({"image": image_paths, "text": texts})
ds = ds.cast_column("image", Image())
# the dataset is ready, and you can even share it on the Hugging face Hub
ds.push_to_hub("oo92/my_dataset")
# and later
ds = load_dataset("oo92/my_dataset")

```
