Skip to content

Commit dacaebf

Browse files
committed
fix test_ovis_1_6_llama
Signed-off-by: ZX-ModelCloud <zx@modelcloud.ai>
1 parent e345392 commit dacaebf

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

gptqmodel/models/definitions/ovis.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import copy
77
import logging
8+
from types import SimpleNamespace
89
from typing import Dict
910

1011
import torch
@@ -18,6 +19,17 @@
1819

1920

2021
class OvisQModel(BaseQModel):
22+
HF_CONVERSION_MAP_REVERSED = (
23+
# Ovis 1.6 builds the SigLIP visual backbone via `AutoModel`, whose
24+
# runtime shell exposes `visual_tokenizer.backbone.*` directly, while
25+
# checkpoint tensors still live under `visual_tokenizer.backbone.vision_model.*`.
26+
SimpleNamespace(
27+
source_patterns=[r"^visual_tokenizer\.backbone\.(?!vision_model\.)(.+)$"],
28+
target_patterns=[r"^visual_tokenizer.backbone.vision_model.\1"],
29+
operations=[],
30+
),
31+
)
32+
2133
pre_lm_head_norm_module = "llm.model.norm"
2234

2335
module_tree = [

gptqmodel/utils/structure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,7 @@ def _copy_checkpoint_tensors_into_submodule(
19361936
grouped_names: Dict[str, list[tuple[str, str, str, Optional[int], Optional[int], Optional[int]]]] = {}
19371937
for rel_name in t_params:
19381938
full_name, expert_index, split_index, split_dim = self._resolve_checkpoint_tensor_source(module_path, rel_name)
1939+
print("full_name", full_name, rel_name)
19391940
if full_name is None:
19401941
continue
19411942
shard = self._weight_map.get(full_name)

0 commit comments

Comments
 (0)