fix: fix the bug of loading Internvl3 (#8067)

Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
This commit is contained in:
GuoYipin
2025-07-20 22:22:54 +08:00
committed by GitHub
parent 99aefa037e
commit 750838adc4

View File

@@ -9,6 +9,7 @@ from transformers import (
LlamaConfig, LlamaConfig,
PretrainedConfig, PretrainedConfig,
PreTrainedTokenizer, PreTrainedTokenizer,
Qwen2Config,
) )
from sglang.utils import logger from sglang.utils import logger
@@ -311,6 +312,8 @@ class InternVLChatConfig(PretrainedConfig):
self.llm_config = LlamaConfig(**llm_config) self.llm_config = LlamaConfig(**llm_config)
elif llm_config.get("architectures")[0] == "InternLM2ForCausalLM": elif llm_config.get("architectures")[0] == "InternLM2ForCausalLM":
self.llm_config = InternLM2Config(**llm_config) self.llm_config = InternLM2Config(**llm_config)
elif llm_config.get("architectures")[0] == "Qwen2ForCausalLM":
self.llm_config = Qwen2Config(**llm_config)
else: else:
raise ValueError( raise ValueError(
"Unsupported architecture: {}".format( "Unsupported architecture: {}".format(