Because the filtering script chunks the dataset by default, you must manually merge the chunks back together. To do this, iterate through the generated configuration names (e.g., gen-{start}-{end}) and the filtered configuration names (e.g., filt-0.1-0.6-{start}-{end}) using load_dataset with the appropriate revision and config_name, then use concatenate_datasets to combine them. Finally, use push_to_hub to save the merged datasets back to the Hugging Face Hub.
Note: The example below uses the gen revision for the original datasets and the pass_rate revision for the filtered datasets.
from datasets import load_dataset, concatenate_datasets
name = "open-r1/DAPO-Math-17k-Processed-R1-Distill-Qwen-Math-7B-Merges-v00.02-v01.02-0.3-0.7-filter"
gen_datasets = []
filt_datasets = []
for start in range(0,17400,200):
end = start + 200
if start == 17200:
end = 17398
gen_config_name = f"gen-{start}-{end}"
gen_dataset = load_dataset(name, gen_config_name, revision="gen", split="train")
gen_datasets.append(gen_dataset)
filt_config_name = f"filt-0.1-0.6-{start}-{end}"
filt_dataset = load_dataset(name, filt_config_name, revision="pass_rate", split="train")
filt_datasets.append(filt_dataset)
gen_dataset = concatenate_datasets(gen_datasets)
gen_dataset.push_to_hub(name, config_name="gen", split="train")
print(gen_dataset)
filt_dataset = concatenate_datasets(filt_datasets)
filt_dataset.push_to_hub(name, config_name="default", split="train")
print(filt_dataset)