@@ -5124,12 +5124,10 @@ static bool llm_load_tensors(
5124
5124
// output
5125
5125
{
5126
5126
model.output_norm = ml.create_tensor(ctx_output, tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd});
5127
- if (model.arch != LLM_ARCH_MINICPM){
5128
- model.output = ml.create_tensor(ctx_output_split, tn(LLM_TENSOR_OUTPUT, "weight"), {n_embd, n_vocab}, llama_model_loader::TENSOR_NOT_REQUIRED);
5129
- // if output is NULL, init from the input tok embed
5130
- if (model.output == NULL) {
5131
- model.output = ml.create_tensor(ctx_output, tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, llama_model_loader::TENSOR_DUPLICATED);
5132
- }
5127
+ model.output = ml.create_tensor(ctx_output_split, tn(LLM_TENSOR_OUTPUT, "weight"), {n_embd, n_vocab}, llama_model_loader::TENSOR_NOT_REQUIRED);
5128
+ // if output is NULL, init from the input tok embed
5129
+ if (model.output == NULL) {
5130
+ model.output = ml.create_tensor(ctx_output, tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, llama_model_loader::TENSOR_DUPLICATED);
5133
5131
}
5134
5132
}
5135
5133
@@ -10212,7 +10210,7 @@ struct llm_build_context {
10212
10210
cb(cur, "lmhead_scaling", -1);
10213
10211
10214
10212
// lm_head
10215
- cur = ggml_mul_mat(ctx0, model.tok_embd , cur);
10213
+ cur = ggml_mul_mat(ctx0, model.output , cur);
10216
10214
cb(cur, "result_output", -1);
10217
10215
10218
10216
ggml_build_forward_expand(gf, cur);
0 commit comments