Fix: failing CI after #30568 (#30599)

* failiing CI

* no let's keep it intil full deprecation in  v4.42
This commit is contained in:
Raushan Turganbay 2024-05-02 12:15:17 +05:00 committed by GitHub
parent c681b58b06
commit 5cf3e6bf05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]