Download data2/step22/alignment.py from SciCode/dataset-builder: direct link, hf CLI and curl.
- Browser
- Download file 569 Bytes
-
https://huggingface.co/SciCode/dataset-builder/resolve/main/data2/step22/alignment.py
- Command line
-
hf download hf://SciCode/dataset-builder/data2/step22/alignment.py
-
curl -L -o alignment.py https://huggingface.co/SciCode/dataset-builder/resolve/main/data2/step22/alignment.py
569 Bytes
| 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) | |