mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
parent
be50a0338b
commit
4aa17d0069
@ -131,23 +131,5 @@ class LlavaConfig(PretrainedConfig):
|
||||
text_config = CONFIG_MAPPING["llama"]()
|
||||
|
||||
self.text_config = text_config
|
||||
self._vocab_size = self.text_config.vocab_size
|
||||
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@property
|
||||
def vocab_size(self):
|
||||
warnings.warn(
|
||||
"The `vocab_size` attribute is deprecated and will be removed in v4.42, Please use `text_config.vocab_size` instead.",
|
||||
FutureWarning,
|
||||
)
|
||||
return self._vocab_size
|
||||
|
||||
@vocab_size.setter
|
||||
def vocab_size(self, value):
|
||||
self._vocab_size = value
|
||||
|
||||
def to_dict(self):
|
||||
output = super().to_dict()
|
||||
output.pop("_vocab_size", None)
|
||||
return output
|
||||
|
@ -13,8 +13,6 @@
|
||||
# limitations under the License.
|
||||
"""VipLlava model configuration"""
|
||||
|
||||
import warnings
|
||||
|
||||
from ...configuration_utils import PretrainedConfig
|
||||
from ...utils import logging
|
||||
from ..auto import CONFIG_MAPPING
|
||||
@ -90,13 +88,6 @@ class VipLlavaConfig(PretrainedConfig):
|
||||
self.projector_hidden_act = projector_hidden_act
|
||||
self.projector_layernorm_eps = projector_layernorm_eps
|
||||
self.vision_feature_layers = vision_feature_layers
|
||||
|
||||
if "vocab_size" in kwargs:
|
||||
warnings.warn(
|
||||
"The `vocab_size` argument is deprecated and will be removed in v4.42, since it can be inferred from the `text_config`. Passing this argument has no effect",
|
||||
FutureWarning,
|
||||
)
|
||||
|
||||
self.vision_config = vision_config
|
||||
|
||||
if isinstance(self.vision_config, dict):
|
||||
@ -123,19 +114,5 @@ class VipLlavaConfig(PretrainedConfig):
|
||||
text_config = CONFIG_MAPPING["llama"]()
|
||||
|
||||
self.text_config = text_config
|
||||
self._vocab_size = self.text_config.vocab_size
|
||||
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@property
|
||||
def vocab_size(self):
|
||||
warnings.warn(
|
||||
"The `vocab_size` attribute is deprecated and will be removed in v4.42, Please use `text_config.vocab_size` instead.",
|
||||
FutureWarning,
|
||||
)
|
||||
return self._vocab_size
|
||||
|
||||
def to_dict(self):
|
||||
output = super().to_dict()
|
||||
output.pop("_vocab_size", None)
|
||||
return output
|
||||
|
Loading…
Reference in New Issue
Block a user