From 4ed88da2ea2a51edc158efe0ee2a1e452d75644d Mon Sep 17 00:00:00 2001 From: Lines Date: Tue, 10 Nov 2026 20:00:03 +0800 Subject: [PATCH] convert : workaround conversion for p-e-w/gpt-oss-20b-heretic-ara-v4 (#31860) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(conversion-base): changed tokenizer init only for gpt-oss checkpoints, no content modification * fix(conversion-gpt_oss): normalized 4 tensor suffixes, no content modification * fix: whitespaces * revert fix(conversion-base) per #31860 * updated conversion/gpt_oss.py alt->erro reframe Co-authored-by: Sigbjørn Skjæret --------- Co-authored-by: Sigbjørn Skjæret --- conversion/gpt_oss.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/conversion/gpt_oss.py b/conversion/gpt_oss.py index 7542ec0ea..c4cae9611 100644 --- a/conversion/gpt_oss.py +++ b/conversion/gpt_oss.py @@ -85,6 +85,16 @@ class GptOssModel(TextModel): def filter_tensors(cls, item: tuple[str, Callable[[], Tensor]]) -> tuple[str, Callable[[], Tensor]] | None: name, gen = item + # Normalize erroneous GPT-OSS MXFP4 tensor naming. + # https://github.com/p-e-w/heretic/pull/211#issuecomment-5094370390 + if "mlp.experts." in name: + for proj in ("down_proj", "gate_up_proj"): + name = name.replace( + f"{proj}_blocks_blocks", f"{proj}_blocks" + ).replace( + f"{proj}_blocks_scales", f"{proj}_scales" + ) + if "sinks" in name: name += ".weight"