Spaces:
Sleeping
Sleeping
def transform_data(data): | |
transformed_data = {"id": hash(data["source"]), "conversations": []} | |
for item in data["conversation"]: | |
transformed_data["conversations"].extend([ | |
{"from": "human", "value": item["input"]}, | |
{"from": "gpt", "value": item["output"]} | |
]) | |
return transformed_data |