Skip to content

Commit aa6dff0

Browse files
huydt84huydt-bti
andauthored
convert: small addition to support LlamaModel (#13838)
Co-authored-by: dinhhuy <[email protected]>
1 parent c962ae3 commit aa6dff0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

convert_hf_to_gguf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,8 @@ def prepare_tensors(self):
18411841
"MistralForCausalLM",
18421842
"MixtralForCausalLM",
18431843
"VLlama3ForCausalLM",
1844-
"LlavaForConditionalGeneration")
1844+
"LlavaForConditionalGeneration",
1845+
"LlamaModel")
18451846
class LlamaModel(TextModel):
18461847
model_arch = gguf.MODEL_ARCH.LLAMA
18471848
undo_permute = True
@@ -1921,6 +1922,8 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
19211922

19221923
if is_vision_tensor:
19231924
return [] # skip vision tensors
1925+
elif self.hf_arch == "LlamaModel":
1926+
name = "model." + name
19241927
elif name.startswith("model.text_model"):
19251928
name = name.replace("text_model.", "") # for SmolVLM
19261929
elif name.startswith("language_model."):

0 commit comments

Comments
 (0)