| import json | |
| input_file = "./log/Qwen2.5-VL-7B-Instruct/ours_20250926_165503.jsonl" | |
| output_file = "tmp.jsonl" | |
| # 读取前 10 条 | |
| with open(input_file, "r", encoding="utf-8") as fin: | |
| lines = [next(fin) for _ in range(10)] # 取前10行 | |
| # 保存到新的 jsonl | |
| with open(output_file, "w", encoding="utf-8") as fout: | |
| fout.writelines(lines) | |
| print(f"已保存前10条到 {output_file}") | |