Code2pdf 67c734433f773
Code2pdf 67c734433f773
def formatting_prompts_func(example):
output_texts = []
# Constructing a standard Alpaca (https://github.com/tatsu-lab/stanford_alpaca#data-release) prompt
mssg = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
for i in range(len(example["instruction"])):
text = f"{mssg}\n### Instruction:\n{example['instruction'][i]}\n### Response: {example['response'][i]}"
output_texts.append(text)
return output_texts
return client_trainset