Skip to content

Commit

Permalink
fix: fix the usage of the code model
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanFM committed May 31, 2024
1 parent 21936dd commit 9a65c7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions convert-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2442,10 +2442,10 @@ def get_tensors(self):
if 'gated_layer' in name:
d1 = data[:self.intermediate_size, :]
name1 = name.replace('gated_layers', 'gated_layers_w')
name1 = name.replace('up_gated_layer', 'gated_layers_w')
name1 = name.replace('up_gated_layer', 'gated_layers_v')
d2 = data[self.intermediate_size:, :]
name2 = name.replace('gated_layers', 'gated_layers_v')
name2 = name.replace('up_gated_layer', 'gated_layers_v')
name2 = name.replace('up_gated_layer', 'gated_layers_w')
yield name1, d1
yield name2, d2
continue
Expand Down
4 changes: 3 additions & 1 deletion llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5498,7 +5498,7 @@ static bool llm_load_tensors(

layer.ffn_down_b = ml.create_tensor(ctx_layer, tn(LLM_TENSOR_FFN_DOWN, "bias", i), {n_embd});
} else {
layer.ffn_gate = ml.create_tensor(ctx_split, tn(LLM_TENSOR_FFN_GATE, "weight", i), {n_embd, n_ff});
layer.ffn_gate = ml.create_tensor(ctx_split, tn(LLM_TENSOR_FFN_GATE, "weight", i), {n_embd, n_ff});
}

layer.layer_out_norm = ml.create_tensor(ctx_layer, tn(LLM_TENSOR_LAYER_OUT_NORM, "weight", i), {n_embd});
Expand Down Expand Up @@ -8506,6 +8506,8 @@ struct llm_build_context {
cur = llm_build_norm(ctx0, cur, hparams, model.layers[il].attn_out_norm, model.layers[il].attn_out_norm_b, LLM_NORM, cb, il);

if (model.layers[il].attn_norm_2 != nullptr) {
// re-add the layer input
cur = ggml_add(ctx0, cur, inpL);
cur = llm_build_norm(ctx0, cur, hparams, model.layers[il].attn_norm_2, model.layers[il].attn_norm_2_b, LLM_NORM, cb, il);
}

Expand Down

0 comments on commit 9a65c7a

Please sign in to comment.