czczup commited on
Commit
d8e8d88
1 Parent(s): 14e0ba5

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
@@ -33,6 +33,7 @@ def version_cmp(v1, v2, op='eq'):
33
  class InternVLChatModel(PreTrainedModel):
34
  config_class = InternVLChatConfig
35
  main_input_name = 'pixel_values'
 
36
  _no_split_modules = ['InternVisionModel', 'LlamaDecoderLayer']
37
 
38
  def __init__(self, config: InternVLChatConfig, vision_model=None, language_model=None):
 
33
  class InternVLChatModel(PreTrainedModel):
34
  config_class = InternVLChatConfig
35
  main_input_name = 'pixel_values'
36
+ _supports_flash_attn_2 = True
37
  _no_split_modules = ['InternVisionModel', 'LlamaDecoderLayer']
38
 
39
  def __init__(self, config: InternVLChatConfig, vision_model=None, language_model=None):