Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
453e7488
Unverified
Commit
453e7488
authored
Aug 01, 2024
by
Raushan Turganbay
Committed by
GitHub
Aug 01, 2024
Browse files
LLaVa: add cache class attribute (#32278)
cache class flag
parent
14ee2326
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
0 deletions
+6
-0
src/transformers/models/llava/modeling_llava.py
src/transformers/models/llava/modeling_llava.py
+1
-0
src/transformers/models/llava_next/modeling_llava_next.py
src/transformers/models/llava_next/modeling_llava_next.py
+1
-0
src/transformers/models/llava_next_video/modeling_llava_next_video.py
...mers/models/llava_next_video/modeling_llava_next_video.py
+1
-0
src/transformers/models/paligemma/modeling_paligemma.py
src/transformers/models/paligemma/modeling_paligemma.py
+1
-0
src/transformers/models/video_llava/modeling_video_llava.py
src/transformers/models/video_llava/modeling_video_llava.py
+1
-0
src/transformers/models/vipllava/modeling_vipllava.py
src/transformers/models/vipllava/modeling_vipllava.py
+1
-0
No files found.
src/transformers/models/llava/modeling_llava.py
View file @
453e7488
...
@@ -126,6 +126,7 @@ class LlavaPreTrainedModel(PreTrainedModel):
...
@@ -126,6 +126,7 @@ class LlavaPreTrainedModel(PreTrainedModel):
_no_split_modules
=
[
"LlavaVisionAttention"
]
_no_split_modules
=
[
"LlavaVisionAttention"
]
_skip_keys_device_placement
=
"past_key_values"
_skip_keys_device_placement
=
"past_key_values"
_supports_flash_attn_2
=
True
_supports_flash_attn_2
=
True
_supports_cache_class
=
True
def
_init_weights
(
self
,
module
):
def
_init_weights
(
self
,
module
):
# important: this ported version of Llava isn't meant for training from scratch - only
# important: this ported version of Llava isn't meant for training from scratch - only
...
...
src/transformers/models/llava_next/modeling_llava_next.py
View file @
453e7488
...
@@ -232,6 +232,7 @@ class LlavaNextPreTrainedModel(PreTrainedModel):
...
@@ -232,6 +232,7 @@ class LlavaNextPreTrainedModel(PreTrainedModel):
_no_split_modules
=
[
"LlavaNextVisionAttention"
]
_no_split_modules
=
[
"LlavaNextVisionAttention"
]
_skip_keys_device_placement
=
"past_key_values"
_skip_keys_device_placement
=
"past_key_values"
_supports_flash_attn_2
=
True
_supports_flash_attn_2
=
True
_supports_cache_class
=
True
def
_init_weights
(
self
,
module
):
def
_init_weights
(
self
,
module
):
# important: this ported version of LlavaNext isn't meant for training from scratch - only
# important: this ported version of LlavaNext isn't meant for training from scratch - only
...
...
src/transformers/models/llava_next_video/modeling_llava_next_video.py
View file @
453e7488
...
@@ -272,6 +272,7 @@ class LlavaNextVideoPreTrainedModel(PreTrainedModel):
...
@@ -272,6 +272,7 @@ class LlavaNextVideoPreTrainedModel(PreTrainedModel):
_no_split_modules
=
[
"LlavaNextVideoVisionAttention"
]
_no_split_modules
=
[
"LlavaNextVideoVisionAttention"
]
_skip_keys_device_placement
=
"past_key_values"
_skip_keys_device_placement
=
"past_key_values"
_supports_flash_attn_2
=
True
_supports_flash_attn_2
=
True
_supports_cache_class
=
True
def
_init_weights
(
self
,
module
):
def
_init_weights
(
self
,
module
):
# important: this ported version of LlavaNextVideo isn't meant for training from scratch - only
# important: this ported version of LlavaNextVideo isn't meant for training from scratch - only
...
...
src/transformers/models/paligemma/modeling_paligemma.py
View file @
453e7488
...
@@ -127,6 +127,7 @@ class PaliGemmaPreTrainedModel(PreTrainedModel):
...
@@ -127,6 +127,7 @@ class PaliGemmaPreTrainedModel(PreTrainedModel):
_skip_keys_device_placement
=
"past_key_values"
_skip_keys_device_placement
=
"past_key_values"
_supports_flash_attn_2
=
False
_supports_flash_attn_2
=
False
_supports_sdpa
=
True
_supports_sdpa
=
True
_supports_cache_class
=
True
def
_init_weights
(
self
,
module
):
def
_init_weights
(
self
,
module
):
# important: this ported version of PaliGemmaisn't meant for training from scratch - only
# important: this ported version of PaliGemmaisn't meant for training from scratch - only
...
...
src/transformers/models/video_llava/modeling_video_llava.py
View file @
453e7488
...
@@ -126,6 +126,7 @@ class VideoLlavaPreTrainedModel(PreTrainedModel):
...
@@ -126,6 +126,7 @@ class VideoLlavaPreTrainedModel(PreTrainedModel):
_no_split_modules
=
[
"VideoLlavaVisionAttention"
]
_no_split_modules
=
[
"VideoLlavaVisionAttention"
]
_skip_keys_device_placement
=
"past_key_values"
_skip_keys_device_placement
=
"past_key_values"
_supports_flash_attn_2
=
True
_supports_flash_attn_2
=
True
_supports_cache_class
=
True
def
_init_weights
(
self
,
module
):
def
_init_weights
(
self
,
module
):
std
=
(
std
=
(
...
...
src/transformers/models/vipllava/modeling_vipllava.py
View file @
453e7488
...
@@ -135,6 +135,7 @@ class VipLlavaPreTrainedModel(PreTrainedModel):
...
@@ -135,6 +135,7 @@ class VipLlavaPreTrainedModel(PreTrainedModel):
_no_split_modules
=
[
"VipLlavaVisionAttention"
]
_no_split_modules
=
[
"VipLlavaVisionAttention"
]
_skip_keys_device_placement
=
"past_key_values"
_skip_keys_device_placement
=
"past_key_values"
_supports_flash_attn_2
=
True
_supports_flash_attn_2
=
True
_supports_cache_class
=
True
def
_init_weights
(
self
,
module
):
def
_init_weights
(
self
,
module
):
# important: this ported version of VipLlava isn't meant for training from scratch - only
# important: this ported version of VipLlava isn't meant for training from scratch - only
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment