Guard DFlash drafts against metadata-only conversion (#2044)

Co-authored-by: Joel Farthing <262452229+joelfarthing@users.noreply.github.com>
This commit is contained in:
Joel Farthing
2026-06-29 08:26:19 +02:00
committed by GitHub
co-authored by Joel Farthing
parent f96eaddba8
commit d8bb57d644
+9
View File
@@ -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"