]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
spec : auto-detect mtp draft model type (#27005)
authorSigbjørn Skjæret <redacted>
Thu, 13 Aug 2026 11:39:16 +0000 (13:39 +0200)
committerGitHub <redacted>
Thu, 13 Aug 2026 11:39:16 +0000 (13:39 +0200)
common/speculative.cpp

index 862c4f045cccc2f525c2884015e7dfbd3f1634d3..cd2dfc760b8800ec9a7f032c69e299e2eed03df8 100644 (file)
@@ -2246,6 +2246,12 @@ std::vector<common_speculative_type> common_speculative_types_from_gguf(const st
 
     const std::string arch = gguf_get_val_str(gguf_ctx.get(), arch_id);
     if (arch != "dflash") {
+        const uint32_t block_count = gguf_get_val_u32(gguf_ctx.get(), gguf_find_key(gguf_ctx.get(), (arch + ".block_count").c_str()));
+
+        if (gguf_find_tensor(gguf_ctx.get(), ("blk." + std::to_string(block_count - 1) + ".nextn.eh_proj.weight").c_str()) >= 0) {
+            return { COMMON_SPECULATIVE_TYPE_DRAFT_MTP };
+        }
+
         return {};
     }