# ClassLabels when using push\_to\_hub

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fclasslabels-when-using-push-to-hub%2F13214%3E%5C
**Category:** 🤗Datasets\
**Created:** [December 29, 2021, 4:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fclasslabels-when-using-push-to-hub%2F13214 "2021-12-29T16:32:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvilasuero](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@dvilasuero](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdvilasuero)%5C
**Post date:** [December 29, 2021, 4:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fclasslabels-when-using-push-to-hub%2F13214%2F1 "2021-12-29T16:32:56Z")

</div>

Hi!

Congrats on this amazing library.

I am uploading a dataset programmatically using `push_to_hub` and defining the features as follows:

```auto
# ds contains text and label strings
hf_ds = Dataset.from_dict(
    ds,
    features=Features({
        "text": Value("string"),
        "label": ClassLabel(names=['World', 'Sports', ..])
    })
)
hf_ds.push_to_hub("Recognai/corrected_labels_ag_news")

```

The thing is that even if I see the ClassLabel feature when I do `hf_ds.features`. The result on the dataset preview shows the labels as `int` and seems to indicate they’ve been given the `int` type.

Is there something I’m doing wrong on my side?

For reference this is the dataset: [Recognai/corrected\_labels\_ag\_news · Datasets at Hugging Face](https://huggingface.co/datasets/Recognai/corrected_labels_ag_news)

---

<div class="post-metadata">

**Author:** ![dvilasuero](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@dvilasuero](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdvilasuero)%5C
**Post date:** [December 29, 2021, 4:44pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fclasslabels-when-using-push-to-hub%2F13214%2F2 "2021-12-29T16:44:47Z")

</div>

Sorry I’ve seen this has already been tackled here:

> <https://github.com/huggingface/datasets/pull/3467>
>
> When doing \`push\_to\_hub\`, the feature types are lost (see issue https://github.c…om/huggingface/datasets/issues/3394).
> This PR fixes this by also pushing a \`dataset\_infos.json\` file to the Hub, that stores the feature types.
> 
> Other minor changes:
> \- renamed the \`\_\_\_\` separator to \`--\`, since \`--\` is now disallowed in a name in the back-end.
> 
> I tested this feature with datasets like conll2003 that has feature types like \`ClassLabel\` that were previously lost.
> 
> Close https://github.com/huggingface/datasets/issues/3394
> 
> I would like to include this in today's release (though not mandatory), so feel free to comment/suggest changes
