# Long-term reproducibility for \`load\_dataset\`?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flong-term-reproducibility-for-load-dataset%2F134713%3E%5C
**Category:** 🤗Datasets\
**Created:** [January 7, 2025, 8:30pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flong-term-reproducibility-for-load-dataset%2F134713 "2025-01-07T20:30:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erinudacity](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@erinudacity](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ferinudacity)%5C
**Post date:** [January 7, 2025, 8:30pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flong-term-reproducibility-for-load-dataset%2F134713%2F1 "2025-01-07T20:30:13Z")

</div>

I’m running into an issue where some fairly-basic code, which definitely worked about 10 months ago, now produces an error message. The Docker image where the code runs has not changed, so it must be some invisible change from the Hugging Face side

Here is the entire code snippet:

```python
from datasets import load_dataset
dataset = load_dataset("sms_spam")

```

Previously, this retrieved the `sms_spam` dataset. Now, it produces a `KeyError: 'tags'`.

My package versions are:

```auto
datasets==2.18.0
huggingface-hub==0.21.4
transformers==4.36.0

```

I see another thread flagging this same `KeyError`, and the suggested solution is to upgrade `datasets` and `huggingface_hub` [Huggingface dataset install - #4 by John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhuggingface-dataset-install%2F133279%2F4)

I will follow this advice as a temporary solution, but it’s not a permanent fix.

**I am trying to write Hugging Face code that will keep working for years, not stop working after a couple of months!**

Can anyone explain:

1. _ **Whether there is any way to prevent this from happening again?** _ For example, can I “pin” the dataset itself to a particular version? Or some other argument, e.g. the URL that is called when the dataset is loaded? I suppose the alternative is downloading and saving all datasets locally, but that’s less convenient, and convenience is why I’m using `load_dataset` in the first place
2. _ **Why this stopped working?** _ For example, is there a particular discussion or commit message where I can read about how it was decided to make old versions of these packages stop working? Even if it’s not preventable, if I can understand where these conversations are happening, that will let me be less reactive, more proactive

Thanks!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [January 8, 2025, 2:32am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flong-term-reproducibility-for-load-dataset%2F134713%2F2 "2025-01-08T02:32:58Z")

</div>

If there is a place where this discussion is taking place, I think it is github.  
It would be in the Issue or Discussion section.

> **[GitHub - huggingface/datasets: 🤗 The largest hub of ready-to-use datasets for ML...](https://github.com/huggingface/datasets)**
>
> 🤗 The largest hub of ready-to-use datasets for ML models with fast, easy-to-use and efficient data manipulation tools

> **[GitHub - huggingface/huggingface\_hub: The official Python client for the Huggingface...](https://github.com/huggingface/huggingface_hub)**
>
> The official Python client for the Huggingface Hub.

---

<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:** [January 8, 2025, 2:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flong-term-reproducibility-for-load-dataset%2F134713%2F3 "2025-01-08T14:54:12Z")

</div>

Hi ! This old `huggingface_hub` version has an issue that makes it not robust to recent changes on HF, you can fix the issue by using the latest `huggingface_hub` version
