[GLM-OCR] Support GLM-OCR Model (#17582)
Signed-off-by: Xinyuan Tong <xinyuantong.cs@gmail.com> Co-authored-by: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com> Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
This commit is contained in:
@@ -278,6 +278,11 @@ class ModelConfig:
|
||||
]:
|
||||
self.hf_config.architectures[0] = "Glm4MoeForCausalLMNextN"
|
||||
|
||||
if is_draft_model and self.hf_config.architectures[0] in [
|
||||
"GlmOcrForConditionalGeneration",
|
||||
]:
|
||||
self.hf_config.architectures[0] = "GlmOcrForConditionalGenerationNextN"
|
||||
|
||||
if (
|
||||
is_draft_model
|
||||
and self.hf_config.architectures[0] == "LongcatFlashForCausalLM"
|
||||
@@ -935,7 +940,7 @@ class ModelConfig:
|
||||
needs_tf_v5 = is_glm_46vmoe
|
||||
|
||||
tf_version = version.parse(tf_version_str)
|
||||
required_version = version.parse("5.0.0")
|
||||
required_version = version.parse("5.0.0dev0")
|
||||
|
||||
if tf_version < required_version:
|
||||
if needs_tf_v5:
|
||||
@@ -1132,6 +1137,7 @@ multimodal_model_archs = [
|
||||
"Gemma3nForConditionalGeneration",
|
||||
"Glm4vForConditionalGeneration",
|
||||
"Glm4vMoeForConditionalGeneration",
|
||||
"GlmOcrForConditionalGeneration",
|
||||
"GlmAsrForConditionalGeneration",
|
||||
"Grok1VForCausalLM",
|
||||
"Grok1AForCausalLM",
|
||||
|
||||
Reference in New Issue
Block a user