Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e11b2e6

Browse filesBrowse files
authored
Qwen2 : assume tied weights if lm_head/output weights is missing (ggml-org#6738)
1 parent c71bfd7 commit e11b2e6
Copy full SHA for e11b2e6

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎llama.cpp

Copy file name to clipboardExpand all lines: llama.cpp
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5184,7 +5184,13 @@ static bool llm_load_tensors(
51845184
// output
51855185
{
51865186
model.output_norm = ml.create_tensor(ctx_output, tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd});
5187-
model.output = ml.create_tensor(ctx_output_split, tn(LLM_TENSOR_OUTPUT, "weight"), {n_embd, n_vocab});
5187+
model.output = ml.create_tensor(ctx_output_split, tn(LLM_TENSOR_OUTPUT, "weight"), {n_embd, n_vocab}, false);
5188+
// if output is NULL, init from the input tok embed
5189+
if (model.output == NULL) {
5190+
model.output = ml.create_tensor(ctx_output, tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab});
5191+
ml.n_created--; // artificial tensor
5192+
ml.size_data += ggml_nbytes(model.output);
5193+
}
51885194
}
51895195

51905196
for (int i = 0; i < n_layer; ++i) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.