[Fix] Transformers-fallback (GPT-NeoX) + KV pool config (DeepSeek-VL2) (#35244)
Co-authored-by: YanbingJiang <yanbing.jiang@intel.com>
This commit is contained in:
co-authored by
YanbingJiang
parent
046454404a
commit
4dc7dc8518
@@ -907,7 +907,7 @@ class ModelConfig:
|
||||
setattr(self.hf_text_config, "head_dim", self.head_dim)
|
||||
|
||||
self.v_head_dim = getattr(self.hf_text_config, "v_head_dim", None)
|
||||
if self.v_head_dim is None:
|
||||
if self.v_head_dim is None or self.v_head_dim == 0:
|
||||
self.v_head_dim = self.head_dim
|
||||
setattr(self.hf_text_config, "v_head_dim", self.v_head_dim)
|
||||
|
||||
|
||||
@@ -544,6 +544,8 @@ class TransformersBase(nn.Module):
|
||||
"model.score.": "classifier.",
|
||||
"model.classifier.": "classifier.",
|
||||
"transformer.": "model.",
|
||||
"gpt_neox.": "model.",
|
||||
"embed_out.": "lm_head.",
|
||||
"model.": "model.",
|
||||
"lm_head.": "lm_head.",
|
||||
"score.": "classifier.",
|
||||
@@ -581,7 +583,9 @@ class TransformersBase(nn.Module):
|
||||
self.skip_substrs: list[str] = []
|
||||
self.ignore_unexpected_prefixes: list[str] = []
|
||||
self.ignore_unexpected_suffixes: list[str] = []
|
||||
self.skip_substrs.extend([".attn.bias", ".attn.masked_bias", ".masked_bias"])
|
||||
self.skip_substrs.extend(
|
||||
[".attn.bias", ".attn.masked_bias", ".attention.bias", ".masked_bias"]
|
||||
)
|
||||
self.ignore_unexpected_prefixes.extend(["classifier.", "score."])
|
||||
|
||||
if self.quant_config is not None:
|
||||
|
||||
Reference in New Issue
Block a user