From 872d4bd6a61d7a932072669cb84665e7679db46e Mon Sep 17 00:00:00 2001 From: iomgaa Date: Sat, 18 Jul 2026 10:37:28 -0400 Subject: [PATCH] =?UTF-8?q?=E5=B1=821:=20diag=5Fgenerate=20ruff=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- scripts/diag_generate.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/diag_generate.py b/scripts/diag_generate.py index cc96203..cea06e9 100644 --- a/scripts/diag_generate.py +++ b/scripts/diag_generate.py @@ -38,12 +38,17 @@ for i in (900, 950): out = model.generate( **inputs, max_new_tokens=512, do_sample=False, temperature=None, top_p=None ) - completion = tok.decode(out[0][inputs["input_ids"].shape[1] :], skip_special_tokens=True) + completion = tok.decode( + out[0][inputs["input_ids"].shape[1] :], skip_special_tokens=True + ) print(f"===== 样本 {i} 题目 =====") print(ds[i]["messages"][-1]["content"][120:280], "…") - print(f"----- 生成(前 600 字符)-----") + print("----- 生成(前 600 字符)-----") print(completion[:600]) print() -print("判读:应为步骤化数学解答(markdown 风格、以 Answer: 行收尾的倾向);" - "乱码/复读/空输出 = 不通过。", flush=True) +print( + "判读:应为步骤化数学解答(markdown 风格、以 Answer: 行收尾的倾向);" + "乱码/复读/空输出 = 不通过。", + flush=True, +)