| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
- # This file was automatically generated from src/transformers/models/eurobert/modular_eurobert.py.
- # Do NOT edit this file manually as any edits will be overwritten by the generation of
- # the file from the modular. If any change should be done, please apply the change to the
- # modular_eurobert.py file directly. One of our CI enforces this.
- # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
- # Copyright 2025 Nicolas Boizard, Duarte M. Alves, Hippolyte Gisserot-Boukhlef and the EuroBert team. All rights reserved.
- #
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- from ...configuration_utils import strict
- from ...modeling_rope_utils import RopeParameters
- from ...utils import auto_docstring
- from ..llama import LlamaConfig
- @auto_docstring(checkpoint="EuroBERT/EuroBERT-210m")
- @strict
- class EuroBertConfig(LlamaConfig):
- r"""
- mask_token_id (`int`, *optional*, defaults to 128002):
- Mask token id.
- classifier_pooling (`str`, *optional*, defaults to `"late"`):
- The pooling strategy to use for the classifier. Can be one of ['bos', 'mean', 'late'].
- ```python
- >>> from transformers import EuroBertModel, EuroBertConfig
- >>> # Initializing a EuroBert eurobert-base style configuration
- >>> configuration = EuroBertConfig()
- >>> # Initializing a model from the eurobert-base style configuration
- >>> model = EuroBertModel(configuration)
- >>> # Accessing the model configuration
- >>> configuration = model.config
- ```"""
- model_type = "eurobert"
- vocab_size: int = 128256
- hidden_size: int = 768
- intermediate_size: int = 3072
- num_hidden_layers: int = 12
- num_attention_heads: int = 12
- num_key_value_heads: int | None = None
- hidden_act: str = "silu"
- max_position_embeddings: int = 8192
- initializer_range: float = 0.02
- rms_norm_eps: float = 1e-05
- bos_token_id: int | None = 128000
- eos_token_id: int | list[int] | None = 128001
- pad_token_id: int | None = 128001
- mask_token_id: int = 128002
- pretraining_tp: int = 1
- tie_word_embeddings: bool = False
- rope_parameters: RopeParameters | dict | None = None
- attention_bias: bool = False
- attention_dropout: int | float = 0.0
- mlp_bias: bool = False
- head_dim: int | None = None
- classifier_pooling: str = "late"
- def __post_init__(self, **kwargs):
- if self.num_key_value_heads is None:
- self.num_key_value_heads = self.num_attention_heads
- super().__post_init__(**kwargs)
- __all__ = ["EuroBertConfig"]
|