-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Untangle config inheritance #41541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Untangle config inheritance #41541
Changes from 26 commits
a3a8726
7569f17
83db459
66225ab
6d322fa
cd1c645
a744da3
212e609
c45264c
589a776
cb03af1
a7ea9dc
9520541
a94cd75
338558c
0e6f6f7
fb0c58d
05699a7
a913528
87e610d
ad1930e
57b1736
74a4a46
9afe474
f79588e
7d3c3cf
6565152
69efa1f
d909306
796b312
3d01b44
d696e05
9c87fd5
3a41439
c831852
83bc532
1be91a1
f034540
5f803ff
4ef5d93
73d8d24
137493b
c1f0aae
b8ed5b3
be62176
e3333fb
2fba81a
2cc234a
68545e7
233c986
2fd964b
66dd842
fbe85de
1391a5e
f76536e
4fdf142
d046c0f
6c6e720
9fe2176
2d4da5f
840e8ea
5cc58bd
9909482
b2c7337
0e9d3d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,6 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from typing import Optional | ||
|
|
||
| from ...configuration_utils import PreTrainedConfig | ||
| from ...utils import logging | ||
|
|
||
|
|
@@ -160,10 +158,6 @@ class Aimv2TextConfig(PreTrainedConfig): | |
| hidden_act (`str` or `function`, *optional*, defaults to `"silu"`): | ||
| The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`, | ||
| `"relu"`, `"selu"` and `"gelu_new"` `"quick_gelu"` are supported. | ||
| pad_token_id (`int`, *optional*, defaults to 1): | ||
| The id of the padding token in the vocabulary. | ||
| bos_token_id (`int`, *optional*, defaults to 49406): | ||
| The id of the beginning-of-sequence token in the vocabulary. | ||
| eos_token_id (`int`, *optional*, defaults to 49407): | ||
| The id of the end-of-sequence token in the vocabulary. | ||
| max_position_embeddings (`int`, *optional*, defaults to 77): | ||
|
|
@@ -188,14 +182,13 @@ def __init__( | |
| qkv_bias: bool = False, | ||
| mlp_bias: bool = False, | ||
| hidden_act: str = "silu", | ||
| pad_token_id: Optional[int] = None, | ||
| bos_token_id: Optional[int] = None, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. modular file shows that these were supposed to be deleted with |
||
| eos_token_id: int = 49407, | ||
| max_position_embeddings: int = 77, | ||
| initializer_range: bool = 0.02, | ||
| **kwargs, | ||
| ): | ||
| super().__init__(pad_token_id=pad_token_id, bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs) | ||
| super().__init__(**kwargs) | ||
| self.eos_token_id = eos_token_id | ||
|
|
||
| self.vocab_size = vocab_size | ||
| self.hidden_size = hidden_size | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,9 +62,16 @@ class AlignTextConfig(PreTrainedConfig): | |
| The epsilon used by the layer normalization layers. | ||
| pad_token_id (`int`, *optional*, defaults to 0): | ||
| Padding token id. | ||
| bos_token_id (`int`, *optional*): | ||
| Beginning of stream token id. | ||
| eos_token_id (`int`, *optional*): | ||
| End of stream token id. | ||
| use_cache (`bool`, *optional*, defaults to `True`): | ||
| Whether or not the model should return the last key/values attentions (not used by all models). Only | ||
| relevant if `config.is_decoder=True`. | ||
| is_decoder (`bool`, *optional*, defaults to `False`): | ||
| Whether to only use the decoder in an encoder-decoder architecture, otherwise it has no effect on | ||
| decoder-only or encoder-only architectures. | ||
|
|
||
| Example: | ||
|
|
||
|
|
@@ -99,11 +106,15 @@ def __init__( | |
| initializer_range=0.02, | ||
| layer_norm_eps=1e-12, | ||
| pad_token_id=0, | ||
| bos_token_id=None, | ||
| eos_token_id=None, | ||
| use_cache=True, | ||
| is_decoder=False, | ||
| **kwargs, | ||
| ): | ||
| super().__init__(**kwargs) | ||
|
|
||
| self.is_decoder = is_decoder | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one should be also deleted because it isn't used for most models. Only some classes can be decoder and encoder, like BERT I am keeping it because of the masking utility until all models start using |
||
| self.vocab_size = vocab_size | ||
| self.hidden_size = hidden_size | ||
| self.num_hidden_layers = num_hidden_layers | ||
|
|
@@ -118,6 +129,8 @@ def __init__( | |
| self.layer_norm_eps = layer_norm_eps | ||
| self.use_cache = use_cache | ||
| self.pad_token_id = pad_token_id | ||
| self.bos_token_id = bos_token_id | ||
| self.eos_token_id = eos_token_id | ||
|
|
||
|
|
||
| class AlignVisionConfig(PreTrainedConfig): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those 3 should disappear as well no? They have nothing to do here in general IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these I was not sure 100% because they are kind of general. Any model with a Sequence Classification head on top would need these and i think all models potentially can be classifiers