Copy rl/scripts from HuggingFaceBio/FineDNA-RL@2315ddc
Browse files- rl/scripts/create_dataset.py +62 -0
rl/scripts/create_dataset.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# /// script
|
| 2 |
+
# dependencies = ["datasets>=4", "huggingface_hub"]
|
| 3 |
+
# ///
|
| 4 |
+
"""Build FineDNA-RL from the Carbon-X GRPO prompt blend.
|
| 5 |
+
|
| 6 |
+
The blend is a single subset with weight 1.0, so the trainer's mixture loader shuffles it twice with the mixture seed
|
| 7 |
+
(once per subset, once after concatenation). This script does the same and labels each row with the domain of its
|
| 8 |
+
`task_group`, so the published split holds the rows the trainer sees, in the same order.
|
| 9 |
+
|
| 10 |
+
python scripts/create_dataset.py --output_dataset HuggingFaceBio/FineDNA-RL
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
import argparse
|
| 14 |
+
|
| 15 |
+
from datasets import load_dataset
|
| 16 |
+
from huggingface_hub import HfApi
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
SEED = 0
|
| 20 |
+
SOURCE = "HuggingFaceBio/Rollouts-Carbon-14B-SFT-v36.52-step-000019119"
|
| 21 |
+
SOURCE_CONFIG = "blend_all_v0"
|
| 22 |
+
SOURCE_REVISION = "205d8b22b8e29a364b8922eb3dc96728cb6f65d7"
|
| 23 |
+
COLUMNS = ["prompt", "answer_text", "task_group", "task_type", "verifier_metadata", "gold_answer_json"]
|
| 24 |
+
DOMAINS = {
|
| 25 |
+
"basic_dna": "dna_computation",
|
| 26 |
+
"dna_skills": "dna_computation",
|
| 27 |
+
"seqrecqa_position": "dna_computation",
|
| 28 |
+
"bioreason": "variant_effect_prediction",
|
| 29 |
+
"vepqa": "variant_effect_prediction",
|
| 30 |
+
"genomeqa": "sequence_classification",
|
| 31 |
+
"bio_mcq": "biology_qa",
|
| 32 |
+
"if": "instruction_following",
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def build_dataset():
|
| 37 |
+
ds = load_dataset(SOURCE, SOURCE_CONFIG, split="train", revision=SOURCE_REVISION).select_columns(COLUMNS)
|
| 38 |
+
ds = ds.add_column("domain", [DOMAINS[group] for group in ds["task_group"]])
|
| 39 |
+
return ds.shuffle(seed=SEED).shuffle(seed=SEED)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def main():
|
| 43 |
+
parser = argparse.ArgumentParser()
|
| 44 |
+
parser.add_argument("--output_dataset", default="HuggingFaceBio/FineDNA-RL")
|
| 45 |
+
args = parser.parse_args()
|
| 46 |
+
|
| 47 |
+
dataset = build_dataset()
|
| 48 |
+
print(dataset)
|
| 49 |
+
dataset.push_to_hub(
|
| 50 |
+
args.output_dataset, split="train", private=True, commit_message="Build FineDNA-RL from the Carbon-X GRPO blend"
|
| 51 |
+
)
|
| 52 |
+
HfApi().upload_file(
|
| 53 |
+
path_or_fileobj=__file__,
|
| 54 |
+
path_in_repo="scripts/create_dataset.py",
|
| 55 |
+
repo_id=args.output_dataset,
|
| 56 |
+
repo_type="dataset",
|
| 57 |
+
commit_message="Publish the script that built this dataset",
|
| 58 |
+
)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
if __name__ == "__main__":
|
| 62 |
+
main()
|