import json import os for split in ["train", "valid"]: with open(f"data/topiocqa_{split}.json", "r") as f: data = json.load(f) with open(f"data/topiocqa_{split}.jsonl", "w") as f: for i, turn in enumerate(data): f.write(json.dumps(turn) + "\n") if i % 1000 == 0: print(i)