in evolve-instruct/evolve.py [0:0]
def run(self):
self.create_seed_prompts()
self.create_prompts()
self.create_answers()
list_qa = []
for i in range(len(self.final_prompts)):
if len(self.final_answers[i]) > 10:
list_qa.append(
{
'input': self.final_prompts[i],
'output': self.final_answers[i],
}
)
with open(f"{self.seed_data.replace('.jsonl', '').replace('json', '')}.%s.json" % str(uuid.uuid4())[:4], "wt") as f:
f.write(json.dumps(list_qa, indent=2, ensure_ascii=False))