技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
processing-streaming【数据与研究】Transform map-style and iterable datasets with map/filter/batching, formatting, caching, combining, and streaming-aware workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task is about preparing an already-loaded Dataset, IterableDataset, DatasetDict, or IterableDatasetDict for analysis, training, export, or further processing.
For initial loading from local files or the Hub, route to ../loading-local-hub/SKILL.md. For schema declarations, feature casting, and modality feature types, route to ../features-formats/SKILL.md. For persistent cache locations, offline settings, and CLI environment concerns, route to ../sharing-cli-cache/SKILL.md.
map, filter, select, shuffle, sort, shard, train_test_split, flatten_indices, and to_iterable_dataset.map, filter, shuffle, skip, take, shard, reshard, set_epoch, and framework iteration.remove_columns, features, num_proc, with_indices, and with_rank.set_format, with_format, framework formatters, iter, to_pandas, to_polars, and TensorFlow/PyTorch handoff patterns.concatenate_datasets, interleave_datasets, map-style versus iterable shard behavior.references/processing-workflows.md for practical decision trees and end-to-end patterns for map-style, streaming, batching, framework handoff, and combining datasets.references/api-reference.md for concrete parameter guidance, return semantics, and method differences across Dataset, IterableDataset, and dictionary containers.references/troubleshooting.md when processing fails with Arrow length/schema errors, multiprocessing pickling issues, cache reuse surprises, shuffle limitations, formatter dependency errors, or mixed type failures.scripts/processing_smoke.py --help to see a self-contained smoke check. Run it without arguments to verify local datasets processing behavior without downloading data.Prefer map-style Dataset when you need random access, exact length, deterministic splits, cached Arrow transforms, or repeated inspection. Prefer IterableDataset when data is too large to materialize, when streaming from files or the Hub, or when fast approximate shuffling is sufficient for training.
For batched map, every returned column must have the same length within a batch. If the function changes row counts, overwrite existing columns or pass remove_columns for columns whose old length no longer matches. If the output type should be stable, pass explicit features; for mixed Python types, review on_mixed_types in references/api-reference.md.
Use with_format(...) for non-mutating formatting and set_format(...) for in-place formatting. Framework formatters may require optional packages such as PyTorch, TensorFlow, JAX, pandas, polars, image, or audio extras; do not assume those are installed.