# Hide download count on dataset page

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhide-download-count-on-dataset-page%2F96999%3E%5C
**Category:** 🤗Datasets\
**Created:** [July 12, 2024, 3:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhide-download-count-on-dataset-page%2F96999 "2024-07-12T15:09:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauldoucet](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@pauldoucet](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpauldoucet)%5C
**Post date:** [July 12, 2024, 3:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhide-download-count-on-dataset-page%2F96999%2F1 "2024-07-12T15:09:47Z")

</div>

Good morning,

Is there a way to hide the download count on the dataset page? In our case ([MahmoodLab/hest · Datasets at Hugging Face](https://huggingface.co/datasets/MahmoodLab/hest)) it’s easier to use `snapshot_download` instead of `load_dataset` because of the format of Spatial Transcriptomics data (.h5, .tiff), therefore the download count isn’t incrementing.

Thank you

---

<div class="post-metadata">

**Author:** ![pauldoucet](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@pauldoucet](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpauldoucet)%5C
**Post date:** [July 14, 2024, 12:46am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhide-download-count-on-dataset-page%2F96999%2F2 "2024-07-14T00:46:40Z")

</div>

Actually, the main reason why we are not using `load_dataset` is because files are being renamed to some hash in the cache. Is there a way to create a custom dataset loading script (datasets.GeneratorBasedBuilder) such that files are not being renamed?

---

<div class="post-metadata">

**Author:** ![pauldoucet](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@pauldoucet](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpauldoucet)%5C
**Post date:** [July 14, 2024, 2:55pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhide-download-count-on-dataset-page%2F96999%2F3 "2024-07-14T14:55:42Z")

</div>

Using `snapshot_download` inside `_split_generators` seems to be the solution:

```auto
import datasets
from datasets import Features, Value
from huggingface_hub import snapshot_download

class HestDataset(datasets.GeneratorBasedBuilder):
    def _info(self):
        return datasets.DatasetInfo(
            description="HEST: A Dataset for Spatial Transcriptomics and Histology Image Analysis",
            homepage="https://github.com/mahmoodlab/hest",
            license="CC BY-NC-SA 4.0 Deed",
            features=Features({
                'path': Value('string')
            })
        )

    def _split_generators(self, dl_manager):
        # Download files using the huggingface_hub API
        filenames = [f.split('hest@main/')[-1] for f in self.config_kwargs['data_files']['train']]
        extracted_files = {}
        snapshot_download(repo_id=self.repo_id, allow_patterns=filenames, repo_type="dataset", local_dir=self._cache_dir_root)
        extracted_files['data'] = filenames
        return [
            datasets.SplitGenerator(
                name=datasets.Split.TRAIN,
                gen_kwargs={"filepath": extracted_files["data"]},
        )]

    def _generate_examples(self, filepath):
        idx = 0
        for file in filepath:
            yield idx, {
                'path': file
            }
            idx += 1

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [July 15, 2024, 2:55am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhide-download-count-on-dataset-page%2F96999%2F4 "2024-07-15T02:55:49Z")

</div>

Closed on July 15, 2024, 2:55am UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
