import json
from datasets import load_dataset, Dataset


SAVE_PATH = "datasets/gsm_symbolic_p2_test.jsonl"

data = load_dataset('apple/GSM-Symbolic', 'p2')["test"]

with open(SAVE_PATH, 'w', encoding='utf-8') as f:
    for item in data:
        json.dump(item, f)
        f.write('\n')

print(f"Saved {len(data)} samples to {SAVE_PATH}")
