@@ -13551,6 +13551,27 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
1355113551 yield from super().modify_tensors(data_torch, name, bid)
1355213552
1355313553
13554+ @ModelBase.register("Sarashina2VisionForCausalLM")
13555+ class Sarashina2VLTextModel(LlamaModel):
13556+ model_arch = gguf.MODEL_ARCH.LLAMA
13557+
13558+ @classmethod
13559+ def filter_tensors(cls, item: tuple[str, Callable[[], Tensor]]) -> tuple[str, Callable[[], Tensor]] | None:
13560+ name, gen = item
13561+ if name.startswith("llm."):
13562+ name = name.replace("llm.", "", 1)
13563+ elif name.startswith("norm."):
13564+ return None
13565+ return super().filter_tensors((name, gen))
13566+
13567+
13568+ @ModelBase.register("Sarashina2VisionForCausalLM")
13569+ class Sarashina2VLVisionModel(Qwen2VLVisionModel):
13570+ def __init__(self, *args, **kwargs):
13571+ super().__init__(*args, **kwargs)
13572+ self.global_config['model_type'] = "qwen2_vl"
13573+
13574+
1355413575###### CONVERSION LOGIC ######
1355513576
1355613577
@@ -13807,7 +13828,7 @@ def get_model_architecture(hparams: dict[str, Any], model_type: ModelType) -> st
1380713828 # Step3-VL keeps text config under text_config but uses a custom top-level architecture.
1380813829 # For text conversion we route to a dedicated text-only class.
1380913830 # TODO: refactor this later to avoid adding exception here
13810- if model_type == ModelType.TEXT and arch == "StepVLForConditionalGeneration":
13831+ if model_type == ModelType.TEXT and arch in ( "StepVLForConditionalGeneration", "Sarashina2VisionForCausalLM") :
1381113832 return arch
1381213833
1381313834 # if "architectures" is found in the sub-config, use that instead
0 commit comments