test-public-space / prepare_data_set.py
phuong-d-h-nguyen's picture
Upload folder using huggingface_hub
9b148bc verified
raw
history blame
352 Bytes
import json
def create_instruction(sample):
return {
"prompt": sample[0],
"completion": sample[1]
}
# load dataset
with open("../evaluation_kit/dataset/set_v1.0.json") as f:
dataset = json.load(f)
dataset = list(map(create_instruction, dataset))
with open("finetuning_set_v1.0.json", "w") as f:
json.dump(dataset, f)