From 7dd84b092418c3a6a8cb7646cde3b33092cddff4 Mon Sep 17 00:00:00 2001 From: Pierrick HYMBERT Date: Sun, 7 Apr 2024 19:12:24 +0200 Subject: [PATCH] model: dbrx: fix expert reshape --- convert-hf-to-gguf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index ca0a73ad0..1e9effc26 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -1548,7 +1548,7 @@ class DbrxModel(Model): # Reshape experts tensors from 2D to 3D as expected by GeLU if experts and n_dims == 2: - data = data.reshape((self.hparams["d_model"], self.hparams["ffn_config"]["ffn_hidden_size"], self.hparams["ffn_config"]["moe_num_experts"])) + data = data.reshape((self.hparams["ffn_config"]["moe_num_experts"], self.hparams["ffn_config"]["ffn_hidden_size"], self.hparams["d_model"])) n_dims = len(data.shape) # if f32 desired, convert any float16 to float32