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"