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
5cf3e6bf
Unverified
Commit
5cf3e6bf
authored
May 02, 2024
by
Raushan Turganbay
Committed by
GitHub
May 02, 2024
Browse files
Fix: failing CI after #30568 (#30599)
* failiing CI * no let's keep it intil full deprecation in v4.42
parent
c681b58b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+3
-0
No files found.
src/transformers/modeling_utils.py
View file @
5cf3e6bf
...
...
@@ -1905,6 +1905,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
return
model_embeds
# Update base model and current model config
if
hasattr
(
self
.
config
,
"text_config"
):
self
.
config
.
text_config
.
vocab_size
=
model_embeds
.
weight
.
shape
[
0
]
# TODO: to be removed after v4.42, config.vocab_size is deprecated for models that have a config.text_config
self
.
config
.
vocab_size
=
model_embeds
.
weight
.
shape
[
0
]
self
.
vocab_size
=
model_embeds
.
weight
.
shape
[
0
]
...
...
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