Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
89f0fda5
Unverified
Commit
89f0fda5
authored
Mar 20, 2023
by
yqy2001
Committed by
GitHub
Mar 20, 2023
Browse files
Fix the gradient checkpointing bug of the llama model (#22270)
fix grad ckpt bug of llama
parent
cf0af9a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/llama/modeling_llama.py
src/transformers/models/llama/modeling_llama.py
+1
-1
No files found.
src/transformers/models/llama/modeling_llama.py
View file @
89f0fda5
...
...
@@ -372,7 +372,7 @@ class LlamaPreTrainedModel(PreTrainedModel):
module
.
weight
.
data
[
module
.
padding_idx
].
zero_
()
def
_set_gradient_checkpointing
(
self
,
module
,
value
=
False
):
if
isinstance
(
module
,
(
Llama
DecoderLayer
)
):
if
isinstance
(
module
,
Llama
Model
):
module
.
gradient_checkpointing
=
value
...
...
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