Download reconstruct_task1_exec.py from testcase-evaluate/all-Mistral-Small-24B-Instruct-2501: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/testcase-evaluate/all-Mistral-Small-24B-Instruct-2501/resolve/main/reconstruct_task1_exec.py
- Command line
-
hf download hf://datasets/testcase-evaluate/all-Mistral-Small-24B-Instruct-2501/reconstruct_task1_exec.py
-
curl -L -o reconstruct_task1_exec.py https://huggingface.co/datasets/testcase-evaluate/all-Mistral-Small-24B-Instruct-2501/resolve/main/reconstruct_task1_exec.py
1.1 kB
| #!/usr/bin/env python3 | |
| # 重组文件 task1_exec.jsonl 的脚本 | |
| import os | |
| from pathlib import Path | |
| def reconstruct_file(): | |
| output_file = "task1_exec.jsonl" | |
| chunk_files = [ | |
| "task1_exec.part000.jsonl", | |
| "task1_exec.part001.jsonl", | |
| "task1_exec.part002.jsonl", | |
| "task1_exec.part003.jsonl", | |
| "task1_exec.part004.jsonl", | |
| "task1_exec.part005.jsonl", | |
| "task1_exec.part006.jsonl", | |
| "task1_exec.part007.jsonl", | |
| "task1_exec.part008.jsonl", | |
| "task1_exec.part009.jsonl", | |
| "task1_exec.part010.jsonl", | |
| ] | |
| print(f"重组文件: {output_file}") | |
| with open(output_file, 'wb') as outfile: | |
| for chunk_file in chunk_files: | |
| if os.path.exists(chunk_file): | |
| print(f"添加分片: {chunk_file}") | |
| with open(chunk_file, 'rb') as infile: | |
| outfile.write(infile.read()) | |
| else: | |
| print(f"警告: 分片文件不存在 {chunk_file}") | |
| print(f"重组完成: {output_file}") | |
| if __name__ == "__main__": | |
| reconstruct_file() | |