Skip to content

Commit b5e72ed

Browse files
committed
vision: fix models missing "text_config"
1 parent f48f51d commit b5e72ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

convert_hf_to_gguf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,8 @@ def __init__(self, *args, **kwargs):
10871087
raise TypeError("VisionModel must be subclassed with model_arch = gguf.MODEL_ARCH.CLIP_VISION")
10881088

10891089
# get n_embd of the text model
1090+
if "text_config" not in self.hparams:
1091+
self.hparams["text_config"] = {}
10901092
text_config = {**self.hparams, **self.hparams["text_config"]}
10911093
self.n_embd_text = text_config.get("hidden_size", text_config.get("n_embd", 0))
10921094
assert self.n_embd_text > 0, "n_embd not found in hparams"

0 commit comments

Comments
 (0)