SunDou's picture
Upload data2/step22/alignment.py with huggingface_hub
50b41da verified
import jsonlines
results = {}
with jsonlines.open("/home/weifengsun/tangou1/step2/step22/output/gemini_results.jsonl", "r") as reader:
for obj in reader:
results[obj["idx"]] = obj
with jsonlines.open("/home/weifengsun/tangou1/step2/step22/output/function_filtered_scores.jsonl", "r") as reader, jsonlines.open("/home/weifengsun/tangou1/step2/step22/output/alignment.jsonl", "w") as writer:
for idx, obj in enumerate(reader):
if idx not in results:
continue
obj["results"] = results[idx]
writer.write(obj)