[Model] Fix GLM-OCR MTP weight loading (#49869)
Signed-off-by: jackLei0901 <42642542+jackLei0901@users.noreply.github.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
@@ -1723,7 +1723,6 @@ _SPECULATIVE_DECODING_EXAMPLE_MODELS = {
|
|||||||
"GlmOcrMTPModel": _HfExamplesInfo(
|
"GlmOcrMTPModel": _HfExamplesInfo(
|
||||||
"zai-org/GLM-OCR",
|
"zai-org/GLM-OCR",
|
||||||
speculative_model="zai-org/GLM-OCR",
|
speculative_model="zai-org/GLM-OCR",
|
||||||
is_available_online=False,
|
|
||||||
min_transformers_version="5.1.0",
|
min_transformers_version="5.1.0",
|
||||||
),
|
),
|
||||||
"HYV3MTPModel": _HfExamplesInfo(
|
"HYV3MTPModel": _HfExamplesInfo(
|
||||||
|
|||||||
@@ -556,7 +556,13 @@ def get_spec_layer_idx_from_weight_name(
|
|||||||
return None
|
return None
|
||||||
base = config.num_hidden_layers
|
base = config.num_hidden_layers
|
||||||
for i in range(n):
|
for i in range(n):
|
||||||
if weight_name.startswith((f"model.layers.{base + i}.", f"layers.{base + i}.")):
|
if weight_name.startswith(
|
||||||
|
(
|
||||||
|
f"model.layers.{base + i}.",
|
||||||
|
f"layers.{base + i}.",
|
||||||
|
f"model.language_model.layers.{base + i}.",
|
||||||
|
)
|
||||||
|
):
|
||||||
return base + i
|
return base + i
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user