From b5e72ed35022b3b41ac003bed5a2d02bb2f46ace Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Wed, 30 Apr 2025 17:22:28 +0200 Subject: [PATCH] vision: fix models missing "text_config" --- convert_hf_to_gguf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index 21a4cf7192..0e447db709 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -1087,6 +1087,8 @@ class VisionModel(ModelBase): raise TypeError("VisionModel must be subclassed with model_arch = gguf.MODEL_ARCH.CLIP_VISION") # get n_embd of the text model + if "text_config" not in self.hparams: + self.hparams["text_config"] = {} text_config = {**self.hparams, **self.hparams["text_config"]} self.n_embd_text = text_config.get("hidden_size", text_config.get("n_embd", 0)) assert self.n_embd_text > 0, "n_embd not found in hparams"