Renaming DatasetDict keys>
How do I rename ‘train’ and ‘test’ to ‘test’ and ‘validation’ respectively?DatasetDict({train: Dataset({features: [‘prompt’, ‘completion’],num_rows: 894082})test: Dataset({features: [‘prompt’, ‘completion’],num_rows: 383178})})Thank you, dictionaries are getting easier, and somehow harder at the same time lol
2023-07-17T14:46:28Z
DatasetDictis a subclass ofdict, so you can do this as follows:train_ds = dataset_dict.pop("train")
test_ds = dataset_dict.pop("test")

dataset_dict["test"] = train_ds
dataset_dict["validation"] = test_ds
2023-07-18T16:17:57Z
Thank you for this. And thanks for using my examples, helps to understand it better. Much apprciated!