From: Daniel Bevenius Date: Tue, 20 Jan 2026 05:55:24 +0000 (+0100) Subject: convert : use n_groups instead of hardcoded values in reshape (#18929) X-Git-Tag: upstream/0.0.8067~287 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7dee9ff59ad507304bf43a2682dbe0a89bbc3dce;p=pkg%2Fggml%2Fsources%2Fllama.cpp convert : use n_groups instead of hardcoded values in reshape (#18929) * convert : use n_groups instead of hardcoded values in reshape This commit modifies the conversion script for NemotronHModel to use the 'n_groups' hyperparameter, and allow Python to calculate the the last dimension, using -1, when reshaping the 'mixer.norm.weight' tensor. * use self.n_group instead of self.hparams["n_groups"] --- diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index becbad046..ab015dd2c 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -9212,7 +9212,7 @@ class NemotronHModel(GraniteHybridModel): return [(mapped_name, reshaped_data)] if name.endswith("mixer.norm.weight"): - reshaped_data = data_torch.reshape(8, 512) + reshaped_data = data_torch.reshape(self.n_group, -1) mapped_name = self.map_tensor_name(name) return [(mapped_name, reshaped_data)]