ChatExplorer / dataset_adapters /WizardLMWizardLM_evol_instruct_70k.py
thomasgauthier's picture
will this work?
10c1f9c
raw
history blame contribute delete
439 Bytes
def transform_data(data):
id_value = 1 # You may assign the 'id' value, here I have used 1 for simplicity.
result = {'id': id_value, 'conversations': []}
for key in ('instruction', 'output'):
if key in data:
origin = 'human' if key == 'instruction' else 'gpt'
result['conversations'].append({
'from': origin,
'value': data[key]
})
return result