czczup commited on
Commit
4e4e2bd
1 Parent(s): e1cf09b

Upload folder using huggingface_hub

Browse files
modeling_intern_vit.py CHANGED
@@ -368,6 +368,7 @@ class InternVisionEncoder(nn.Module):
368
 
369
  class InternVisionModel(PreTrainedModel):
370
  main_input_name = 'pixel_values'
 
371
  config_class = InternVisionConfig
372
  _no_split_modules = ['InternVisionEncoderLayer']
373
 
 
368
 
369
  class InternVisionModel(PreTrainedModel):
370
  main_input_name = 'pixel_values'
371
+ _supports_flash_attn_2 = True
372
  config_class = InternVisionConfig
373
  _no_split_modules = ['InternVisionEncoderLayer']
374
 
modeling_internvl_chat.py CHANGED
@@ -34,6 +34,7 @@ def version_cmp(v1, v2, op='eq'):
34
  class InternVLChatModel(PreTrainedModel):
35
  config_class = InternVLChatConfig
36
  main_input_name = 'pixel_values'
 
37
  _no_split_modules = ['InternVisionModel', 'LlamaDecoderLayer', 'Qwen2DecoderLayer']
38
 
39
  def __init__(self, config: InternVLChatConfig, vision_model=None, language_model=None):
 
34
  class InternVLChatModel(PreTrainedModel):
35
  config_class = InternVLChatConfig
36
  main_input_name = 'pixel_values'
37
+ _supports_flash_attn_2 = True
38
  _no_split_modules = ['InternVisionModel', 'LlamaDecoderLayer', 'Qwen2DecoderLayer']
39
 
40
  def __init__(self, config: InternVLChatConfig, vision_model=None, language_model=None):