ChatExplorer / dataset_adapters /LDJnrLessWrong-Amplify-Instruct.py
thomasgauthier's picture
will this work?
10c1f9c
raw
history blame
335 Bytes
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