vision: fix models missing "text_config"
This commit is contained in:
parent
f48f51d185
commit
b5e72ed350
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue