From d8bb57d6447e67ddd39e119a9ac6e767cfba6acd Mon Sep 17 00:00:00 2001 From: Joel Farthing Date: Mon, 29 Jun 2026 01:26:19 -0500 Subject: [PATCH] Guard DFlash drafts against metadata-only conversion (#2044) Co-authored-by: Joel Farthing <262452229+joelfarthing@users.noreply.github.com> --- convert_hf_to_gguf.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index 820c96072..31ba6e1e4 100644 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -2506,6 +2506,15 @@ class DFlashDraftModel(Qwen3Model): def prepare_tensors(self): super().prepare_tensors() + if sum(len(tensors) for tensors in self.gguf_writer.tensors) == 0: + raise ValueError( + "DFlashDraftModel conversion did not find any tensors. " + "DFlash drafts may share target token_embd/output tensors, but the draft " + "model must still provide its own block weights. Make sure the draft " + "directory contains downloaded model weights that this converter can discover, " + "such as model*.safetensors or pytorch_model*.bin; a metadata-only GGUF is not usable." + ) + if self._saw_output and not self._saw_token_embd: raise ValueError( "DFlashDraftModel conversion requires token_embd.weight when output.weight is present"