[Model] Remove Mono-InternVL (InternLM2VEForCausalLM) (#45129)
Signed-off-by: Xianbao QIAN <xianbao.qian@gmail.com> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
This commit is contained in:
co-authored by
Claude
Isotr0py
parent
88ed636218
commit
f1e13f7df9
@@ -177,27 +177,22 @@ class NVLM_D_Model(InternVLChatModel):
|
||||
config: PretrainedConfig,
|
||||
quant_config: QuantizationConfig | None,
|
||||
*,
|
||||
is_mono: bool,
|
||||
prefix: str,
|
||||
):
|
||||
if not is_mono:
|
||||
vision_feature_layer = config.select_layer
|
||||
if vision_feature_layer < 0:
|
||||
num_hidden_layers = (
|
||||
config.vision_config.num_hidden_layers + vision_feature_layer + 1
|
||||
)
|
||||
else:
|
||||
num_hidden_layers = vision_feature_layer + 1
|
||||
|
||||
# We added additional dummy heads to the original num of heads to
|
||||
# make the number of heads divisible by 8.
|
||||
return InternVisionModel(
|
||||
config.vision_config,
|
||||
quant_config=quant_config,
|
||||
num_hidden_layers_override=num_hidden_layers,
|
||||
num_dummy_heads=7,
|
||||
prefix=prefix,
|
||||
vision_feature_layer = config.select_layer
|
||||
if vision_feature_layer < 0:
|
||||
num_hidden_layers = (
|
||||
config.vision_config.num_hidden_layers + vision_feature_layer + 1
|
||||
)
|
||||
else:
|
||||
msg = "Monolith mode is not applicable to NVLM_D"
|
||||
raise NotImplementedError(msg)
|
||||
num_hidden_layers = vision_feature_layer + 1
|
||||
|
||||
# We added additional dummy heads to the original num of heads to
|
||||
# make the number of heads divisible by 8.
|
||||
return InternVisionModel(
|
||||
config.vision_config,
|
||||
quant_config=quant_config,
|
||||
num_hidden_layers_override=num_hidden_layers,
|
||||
num_dummy_heads=7,
|
||||
prefix=prefix,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user