Skip to content

Commit 2fe7759

Browse files
AksharGoyalEduardoPach
authored andcommitted
[docstring] Fix docstring for AltCLIPTextConfig, AltCLIPVisionConfig and AltCLIPConfig (huggingface#27128)
* [docstring] Fix docstring for AltCLIPVisionConfig, AltCLIPTextConfig + cleaned some docstring * Removed entries from check_docstring.py * Removed entries from check_docstring.py * Removed entry from check_docstring.py * [docstring] Fix docstring for AltCLIPTextConfig, AltCLIPVisionConfig and AltCLIPConfig
1 parent a3aefbe commit 2fe7759

File tree

10 files changed

+26
-17
lines changed

10 files changed

+26
-17
lines changed

src/transformers/models/altclip/configuration_altclip.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,19 @@ class AltCLIPTextConfig(PretrainedConfig):
6161
max_position_embeddings (`int`, *optional*, defaults to 514):
6262
The maximum sequence length that this model might ever be used with. Typically set this to something large
6363
just in case (e.g., 512 or 1024 or 2048).
64-
type_vocab_size (`int`, *optional*, defaults to 2):
64+
type_vocab_size (`int`, *optional*, defaults to 1):
6565
The vocabulary size of the `token_type_ids` passed when calling [`AltCLIPTextModel`]
6666
initializer_range (`float`, *optional*, defaults to 0.02):
6767
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
68-
layer_norm_eps (`float`, *optional*, defaults to 1e-5):
68+
initializer_factor (`float`, *optional*, defaults to 0.02):
69+
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
70+
testing).
71+
layer_norm_eps (`float`, *optional*, defaults to 1e-05):
6972
The epsilon used by the layer normalization layers.
73+
pad_token_id (`int`, *optional*, defaults to 1): The id of the *padding* token.
74+
bos_token_id (`int`, *optional*, defaults to 0): The id of the *beginning-of-sequence* token.
75+
eos_token_id (`Union[int, List[int]]`, *optional*, defaults to 2):
76+
The id of the *end-of-sequence* token. Optionally, use a list to set multiple *end-of-sequence* tokens.
7077
position_embedding_type (`str`, *optional*, defaults to `"absolute"`):
7178
Type of position embedding. Choose one of `"absolute"`, `"relative_key"`, `"relative_key_query"`. For
7279
positional embeddings use `"absolute"`. For more information on `"relative_key"`, please refer to
@@ -154,24 +161,28 @@ class AltCLIPVisionConfig(PretrainedConfig):
154161
Dimensionality of the encoder layers and the pooler layer.
155162
intermediate_size (`int`, *optional*, defaults to 3072):
156163
Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
164+
projection_dim (`int`, *optional*, defaults to 512):
165+
Dimentionality of text and vision projection layers.
157166
num_hidden_layers (`int`, *optional*, defaults to 12):
158167
Number of hidden layers in the Transformer encoder.
159168
num_attention_heads (`int`, *optional*, defaults to 12):
160169
Number of attention heads for each attention layer in the Transformer encoder.
170+
num_channels (`int`, *optional*, defaults to 3):
171+
The number of input channels.
161172
image_size (`int`, *optional*, defaults to 224):
162173
The size (resolution) of each image.
163174
patch_size (`int`, *optional*, defaults to 32):
164175
The size (resolution) of each patch.
165176
hidden_act (`str` or `function`, *optional*, defaults to `"quick_gelu"`):
166177
The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
167178
`"relu"`, `"selu"` and `"gelu_new"` ``"quick_gelu"` are supported.
168-
layer_norm_eps (`float`, *optional*, defaults to 1e-5):
179+
layer_norm_eps (`float`, *optional*, defaults to 1e-05):
169180
The epsilon used by the layer normalization layers.
170181
attention_dropout (`float`, *optional*, defaults to 0.0):
171182
The dropout ratio for the attention probabilities.
172183
initializer_range (`float`, *optional*, defaults to 0.02):
173184
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
174-
initializer_factor (`float``, *optional*, defaults to 1):
185+
initializer_factor (`float`, *optional*, defaults to 1.0):
175186
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
176187
testing).
177188

src/transformers/models/bridgetower/configuration_bridgetower.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class BridgeTowerVisionConfig(PretrainedConfig):
4949
The size (resolution) of each patch.
5050
image_size (`int`, *optional*, defaults to 288):
5151
The size (resolution) of each image.
52-
initializer_factor (`float``, *optional*, defaults to 1):
52+
initializer_factor (`float`, *optional*, defaults to 1):
5353
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
5454
testing).
5555
layer_norm_eps (`float`, *optional*, defaults to 1e-05):
@@ -151,7 +151,7 @@ class BridgeTowerTextConfig(PretrainedConfig):
151151
just in case (e.g., 512 or 1024 or 2048).
152152
type_vocab_size (`int`, *optional*, defaults to 2):
153153
The vocabulary size of the `token_type_ids`.
154-
initializer_factor (`float``, *optional*, defaults to 1):
154+
initializer_factor (`float`, *optional*, defaults to 1):
155155
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
156156
testing).
157157
layer_norm_eps (`float`, *optional*, defaults to 1e-05):
@@ -255,7 +255,7 @@ class BridgeTowerConfig(PretrainedConfig):
255255
The non-linear activation function (function or string) in the encoder and pooler.
256256
hidden_size (`int`, *optional*, defaults to 768):
257257
Dimensionality of the encoder layers and the pooler layer.
258-
initializer_factor (`float``, *optional*, defaults to 1):
258+
initializer_factor (`float`, *optional*, defaults to 1):
259259
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
260260
testing).
261261
layer_norm_eps (`float`, *optional*, defaults to 1e-05):

src/transformers/models/chinese_clip/configuration_chinese_clip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class ChineseCLIPVisionConfig(PretrainedConfig):
203203
The dropout ratio for the attention probabilities.
204204
initializer_range (`float`, *optional*, defaults to 0.02):
205205
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
206-
initializer_factor (`float``, *optional*, defaults to 1.0):
206+
initializer_factor (`float`, *optional*, defaults to 1.0):
207207
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
208208
testing).
209209
Example:

src/transformers/models/clipseg/configuration_clipseg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class CLIPSegTextConfig(PretrainedConfig):
6262
The dropout ratio for the attention probabilities.
6363
initializer_range (`float`, *optional*, defaults to 0.02):
6464
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
65-
initializer_factor (`float``, *optional*, defaults to 1.0):
65+
initializer_factor (`float`, *optional*, defaults to 1.0):
6666
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
6767
testing).
6868
pad_token_id (`int`, *optional*, defaults to 1):

src/transformers/models/mask2former/configuration_mask2former.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Mask2FormerConfig(PretrainedConfig):
9393
Ratio of points that are sampled via importance sampling.
9494
init_std (`float`, *optional*, defaults to 0.02):
9595
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
96-
init_xavier_std (`float``, *optional*, defaults to 1.0):
96+
init_xavier_std (`float`, *optional*, defaults to 1.0):
9797
The scaling factor used for the Xavier initialization gain in the HM Attention map module.
9898
use_auxiliary_loss (`boolean``, *optional*, defaults to `True`):
9999
If `True` [`Mask2FormerForUniversalSegmentationOutput`] will contain the auxiliary losses computed using

src/transformers/models/owlv2/configuration_owlv2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class Owlv2VisionConfig(PretrainedConfig):
180180
The dropout ratio for the attention probabilities.
181181
initializer_range (`float`, *optional*, defaults to 0.02):
182182
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
183-
initializer_factor (`float``, *optional*, defaults to 1.0):
183+
initializer_factor (`float`, *optional*, defaults to 1.0):
184184
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
185185
testing).
186186

src/transformers/models/owlvit/configuration_owlvit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class OwlViTVisionConfig(PretrainedConfig):
183183
The dropout ratio for the attention probabilities.
184184
initializer_range (`float`, *optional*, defaults to 0.02):
185185
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
186-
initializer_factor (`float``, *optional*, defaults to 1.0):
186+
initializer_factor (`float`, *optional*, defaults to 1.0):
187187
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
188188
testing).
189189

src/transformers/models/pix2struct/configuration_pix2struct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class Pix2StructVisionConfig(PretrainedConfig):
203203
The dropout ratio for the attention probabilities.
204204
initializer_range (`float`, *optional*, defaults to 1e-10):
205205
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
206-
initializer_factor (`float``, *optional*, defaults to 1.0):
206+
initializer_factor (`float`, *optional*, defaults to 1.0):
207207
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
208208
testing).
209209
seq_len (`int`, *optional*, defaults to 4096):

src/transformers/models/x_clip/configuration_x_clip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class XCLIPTextConfig(PretrainedConfig):
6363
The dropout ratio for the attention probabilities.
6464
initializer_range (`float`, *optional*, defaults to 0.02):
6565
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
66-
initializer_factor (`float``, *optional*, defaults to 1):
66+
initializer_factor (`float`, *optional*, defaults to 1):
6767
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
6868
testing).
6969
@@ -176,7 +176,7 @@ class XCLIPVisionConfig(PretrainedConfig):
176176
The dropout ratio for the attention probabilities.
177177
initializer_range (`float`, *optional*, defaults to 0.02):
178178
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
179-
initializer_factor (`float``, *optional*, defaults to 1):
179+
initializer_factor (`float`, *optional*, defaults to 1):
180180
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
181181
testing).
182182
drop_path_rate (`float`, *optional*, defaults to 0.0):

utils/check_docstrings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@
7979
"AlbertTokenizerFast",
8080
"AlignTextModel",
8181
"AlignVisionConfig",
82-
"AltCLIPTextConfig",
83-
"AltCLIPVisionConfig",
8482
"AudioClassificationPipeline",
8583
"AutoformerConfig",
8684
"AutomaticSpeechRecognitionPipeline",

0 commit comments

Comments
 (0)