Skip to content

Commit 54dd8e2

Browse files
committed
support cosyvoice2 over qwen2
1 parent 6491d6e commit 54dd8e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/llama-model.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
25182518
// output
25192519
output_norm = create_tensor(tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd}, 0);
25202520
output = create_tensor(tn(LLM_TENSOR_OUTPUT, "weight"), {n_embd, n_vocab}, TENSOR_NOT_REQUIRED);
2521+
output_b = create_tensor(tn(LLM_TENSOR_OUTPUT, "bias"), {n_vocab}, TENSOR_NOT_REQUIRED);
25212522
// if output is NULL, init from the input tok embed
25222523
if (output == NULL) {
25232524
output = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, TENSOR_DUPLICATED);
@@ -7171,6 +7172,10 @@ struct llm_build_qwen2 : public llm_graph_context {
71717172
// lm_head
71727173
cur = build_lora_mm(model.output, cur);
71737174

7175+
if (model.output_b != nullptr) {
7176+
cur = ggml_add(ctx0, cur, model.output_b);
7177+
}
7178+
71747179
cb(cur, "result_output", -1);
71757180
res->t_logits = cur;
71767181

0 commit comments

Comments
 (0)