File size: 340 Bytes
fdf190d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import json
import os
names = os.listdir("/home/aiscuser/fhw/data")
lines = []
for name in names:
    if "_with_best_answer" in name:
        f = open(f"/home/aiscuser/fhw/data/{name}", "r+")
        lines.extend(f.readlines())
fw = open("/home/aiscuser/fhw/data/all_instruct_with_answers.json", "w+")
for line in lines:
    fw.write(line)