BitNet-TinyDialogues-1.58b / patches /llama.cpp-bitnet-fixes.patch
zerolimites's picture
BitNet b1.58 TinyDialogues: trained checkpoint, GGUF, scripts, patches
655f931 verified
Raw History Blame Contribute Delete
1.26 kB
diff --git a/gguf-py/gguf/tensor_mapping.py b/gguf-py/gguf/tensor_mapping.py
index ff22a60..783b148 100644
--- a/gguf-py/gguf/tensor_mapping.py
+++ b/gguf-py/gguf/tensor_mapping.py
@@ -1355,10 +1355,12 @@ class TensorNameMap:
MODEL_TENSOR.ATTN_SUB_NORM: (
"model.layers.{bid}.self_attn.inner_attn_ln", # bitnet
+ "model.layers.{bid}.self_attn.attn_sub_norm", # bitnet (transformers >= 4.57)
),
MODEL_TENSOR.FFN_SUB_NORM: (
"model.layers.{bid}.mlp.ffn_layernorm", # bitnet
+ "model.layers.{bid}.mlp.ffn_sub_norm", # bitnet (transformers >= 4.57)
),
MODEL_TENSOR.DEC_ATTN_NORM: (
diff --git a/src/models/bitnet.cpp b/src/models/bitnet.cpp
index a08881b..e9f0124 100644
--- a/src/models/bitnet.cpp
+++ b/src/models/bitnet.cpp
@@ -129,7 +129,7 @@ llama_model_bitnet::graph::graph(const llama_model & model, const llm_graph_para
model.layers[il].ffn_gate, NULL, model.layers[il].ffn_gate_s,
NULL, NULL, NULL,
NULL,
- LLM_FFN_SILU, LLM_FFN_PAR, il);
+ LLM_FFN_RELU_SQR, LLM_FFN_PAR, il);
cb(cur, "ffn_sub_out", il);
cur = build_norm(cur,