Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,17 @@ int llama_model_load_mtp_from_file(struct llama_model * model, const char * path
llama_model_free(aux);
return -7;
}

// Rename all MTP assistant tensors with "mtp." prefix so they can be
// uniquely targeted by -ot rules without colliding with the main model's
// tensors. Tensors already prefixed with "mtp." (pre_projection,
// post_projection, centroids, token_ordering) are left unchanged.
for (auto & kv : aux->tensors_by_name) {
if (kv.first.substr(0, 4) != "mtp.") {
std::string new_name = "mtp." + kv.first;
ggml_set_name(kv.second, new_name.c_str());
kv.first = new_name;
}
}
tgt->mtp_assistant.reset(aux);
return 0;
}
Expand Down