Upload folder using huggingface_hub
Browse filesFiles changed (7)
- .python-versionAdded+1
- README.mdAdded
- lb_data_test/__init__.pyAdded
- lb_data_test/lb_data_test.pyAdded+79
- poetry.lockAdded
- pyproject.tomlAdded+17
- tests/__init__.pyAdded
13.1112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879from typing import Tuplefrom typing import Generator
import datasetsfrom datasets import Value
_DESCRIPTION = """\..."""
_URL = "..."
class LaboASRConfig(datasets.BuilderConfig):
def __init__( self, do_stuff: bool = False, **kwargs, ): super(LaboASRConfig, self).__init__(version=datasets.Version("0.0.1", ""), **kwargs) self.do_stuff = do_stuff
class LaboASR(datasets.GeneratorBasedBuilder):
CORTI_DATASET_NAME = "labo" DEFAULT_WRITER_BATCH_SIZE = 256 DEFAULT_CONFIG_NAME = "default" BUILDER_CONFIG_CLASS = LaboASRConfig
BUILDER_CONFIGS = [ LaboASRConfig( name="default", description="Default config.", ), ]
def _info(self): features = { "transcript": Value("string"), "id": Value("string"), } return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features(features), homepage=_URL, )
def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={ "paths": ["1", "2", "3"], }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={ "paths": ["4", "5", "6"], }, ), ]
def _generate_examples( self, paths: list[str], ) -> Generator[Tuple[int, dict], None, None]:
for i, p in enumerate(paths):
# Yield example example = { "transcript": "Hello, world!", "id": "0000" + p, }
yield i, example1234567891011121314151617[tool.poetry]name = "lb-data-test"version = "0.1.0"description = ""authors = ["Your Name <you@example.com>"]readme = "README.md"
[tool.poetry.dependencies]python = "^3.10"datasets = "^3.2.0"ipython = "^8.31.0"numpy = "^1"
[build-system]requires = ["poetry-core"]build-backend = "poetry.core.masonry.api".python-versionAdded+1
README.mdAdded
lb_data_test/__init__.pyAdded
lb_data_test/lb_data_test.pyAdded+79
poetry.lockAdded
pyproject.tomlAdded+17
tests/__init__.pyAdded