Configure the Viewer

#1
by lhoestq HF Staff - opened

I see the repo has multiple lance datasets inside it.
In that case the Viewer needs to be configured to show a dropdown with every dataset as a separate config

Thanks! @lhoestq

I looked at the configuration docs here: https://huggingface.co/docs/hub/en/datasets-data-files-configuration and tried a few variations to configure spilts (HEK293T, HCT116) and subsets (cells, genes, expression) but seeing some inconsistency in the dataviewer e.g. for this dataset, the configuration is identical across splits but it's displaying only one subset for one split. I see a parsing error message related to data type casting.

If you have a chance, have a look at the yaml frontmatter in my README.md across these datasets and let me know if there's something I can change on my end easily
https://huggingface.co/slaf-project

Ah actually this doesn't work since splits are meant for train/test/validation. This causes splits to always have the same columns, which is not the case here:

In [3]: ds = load_dataset("slaf-project/X-Atlas-Orion", data_files="data/HCT116/genes.lance/**/*", streaming=True)
README.md: 3.54kB [00:00, 3.76MB/s]

In [4]: ds
Out[4]: 
IterableDatasetDict({
    train: IterableDataset({
        features: ['mt', 'n_cells_by_counts', 'mean_counts', 'pct_dropout_by_counts', 'total_counts', 'gene_id', 'gene_integer_id'],
        num_shards: 1
    })
})

In [5]: ds = load_dataset("slaf-project/X-Atlas-Orion", data_files="data/HEK293T/genes.lance/**/*", streaming=True)

In [6]: ds
Out[6]: 
IterableDatasetDict({
    train: IterableDataset({
        features: ['gene_id', 'gene_integer_id'],
        num_shards: 1
    })
})

So you'll need to make sure they have the same columns, or you'll need to uses subsets only:

configs:
- config_name: HEK293T-cells
  data_dir: "data/HEK293T/cells.lance"
- config_name: HEK293T-expression
  data_dir: "data/HEK293T/expression.lance"
- config_name: HEK293T-genes
  data_dir: "data/HEK293T/genes.lance"
- config_name: HCT116-cells
  data_dir: "data/HCT116/cells.lance"
- config_name: HCT116-expression
  data_dir: "data/HCT116/expression.lance"
- config_name: HCT116-genes
  data_dir: "data/HCT116/genes.lance"

Thanks again, this is awesome @lhoestq !

pavan-ramkumar changed pull request status to closed

Sign up or log in to comment