# How to load only test dataset from \`librispeech\_asr\`?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-only-test-dataset-from-librispeech-asr%2F12602%3E%5C
**Category:** 🤗Datasets\
**Created:** [December 7, 2021, 4:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-only-test-dataset-from-librispeech-asr%2F12602 "2021-12-07T04:11:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IlllIIII](https://avatars.discourse-cdn.com/v4/letter/i/ce7236/32.png) [@IlllIIII](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FIlllIIII)%5C
**Post date:** [December 7, 2021, 4:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-only-test-dataset-from-librispeech-asr%2F12602%2F1 "2021-12-07T04:11:59Z")

</div>

Hi, I want to evaluate my model with [Librespeech dataset](https://huggingface.co/datasets/librispeech_asr) 🙂

| | Train.500 | Train.360 | Train.100 | Valid | Test |
| --- | --- | --- | --- | --- | --- |
| clean | - | 104014 | 28539 | 2703 | 2620 |
| other | 148688 | - | - | 2864 | 2939 |

I don’t need `train.500`, `train.360`, `train.100` and `valid` set. Is there any way to load only `test` set from `librispeech_asr`?

I can load all data and only keep `test` set later but it takes too long to load all data :(( So I want to load only `test` set.

```python
from datasets import load_dataset, DatasetDict

# It takes forever to load everything here... 
libre_dataset = load_dataset("librispeech_asr", 'clean')

keep = ["test"]
libre_dataset = DatasetDict({k: dataset for k, dataset in libre_dataset .items() if k in keep})

```

Thanks for reading!

---

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flewtun)%5C
**Post date:** [December 7, 2021, 8:36am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-only-test-dataset-from-librispeech-asr%2F12602%2F2 "2021-12-07T08:36:30Z")

</div>

Hey @IlllIIII you can specify the split you want to load by passing `split="test"` to the `load_dataset()` function ([docs](https://huggingface.co/docs/datasets/loading.html?highlight=split#slice-splits)). This will still _download_ all the splits in the dataset, so if space is an issue you can stream the elements of the test set one by one:

```auto
from datasets import load_dataset

dset = load_dataset("librispeech_asr", 'clean', split="test", streaming=True)
next(iter(dset))

```

---

<div class="post-metadata">

**Author:** ![IlllIIII](https://avatars.discourse-cdn.com/v4/letter/i/ce7236/32.png) [@IlllIIII](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FIlllIIII)%5C
**Post date:** [December 7, 2021, 4:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-only-test-dataset-from-librispeech-asr%2F12602%2F3 "2021-12-07T16:11:25Z")

</div>

Hey, thanks for the tips! It was super useful 🙂
