Add support to return dataset as a HF Dataset object in load_dataset()#116
Open
Kostis-S-Z wants to merge 5 commits into
Open
Add support to return dataset as a HF Dataset object in load_dataset()#116Kostis-S-Z wants to merge 5 commits into
Kostis-S-Z wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
load_dataset()can now return datasets, also as HuggingFacedatasetsobjects using a newreturn_formatargument. pandas DataFrame still remains the default, so this is an optional feature added on top.Changes
return_format="pandas" | "hf"argument onload_dataset(default"pandas", fully backward compatible). With"hf", single-split datasets return aDataset; multi-split datasets (e.g. Common Voice) return aDatasetDictkeyed by split name, driven by the dataset schema'ssplitsfield.uv add / pip install "datacollective[hf]". Without it,return_format="hf"raises aMissingDependencyErrorwith install instructions before any API call or download, so users never hit the error after pulling a large archive.hf_utils.pymodule: loaders are untouched and still produce DataFrames. The conversion happens post-hoc, so both formats always contain identical data.datasetsis imported lazily and only referenced in type annotations underTYPE_CHECKING.cast_column("audio", Audio(...))which might be useful for all the ASR / TTS datasets! Plus, a README Quick Start step, and an HF example indemo_download_and_load.pythat runs only whendatasetsis installed.load_datasetfor both formats.