RaushanTurganbay HF staff commited on
Commit
75a72ea
·
verified ·
1 Parent(s): 35e1ef4

Upload Blip2ForConditionalGeneration

Browse files
Files changed (4) hide show
  1. README.md +199 -0
  2. config.json +9 -193
  3. generation_config.json +8 -0
  4. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags: []
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
config.json CHANGED
@@ -1,11 +1,13 @@
1
  {
2
- "_commit_hash": null,
3
  "architectures": [
4
  "Blip2ForConditionalGeneration"
5
  ],
6
  "bos_token_id": 1,
7
  "decoder_start_token_id": 0,
8
  "eos_token_id": 1,
 
 
9
  "initializer_factor": 1.0,
10
  "initializer_range": 0.02,
11
  "is_encoder_decoder": true,
@@ -13,247 +15,61 @@
13
  "num_query_tokens": 10,
14
  "pad_token_id": 0,
15
  "qformer_config": {
16
- "_name_or_path": "",
17
- "add_cross_attention": false,
18
- "architectures": null,
19
  "attention_dropout": 0.1,
20
- "attention_probs_dropout_prob": 0.1,
21
- "bad_words_ids": null,
22
- "begin_suppress_tokens": null,
23
  "bos_token_id": 0,
24
- "chunk_size_feed_forward": 0,
25
  "classifier_dropout": null,
26
- "cross_attention_frequency": 2,
27
- "cross_attention_hidden_size": null,
28
- "decoder_start_token_id": null,
29
- "diversity_penalty": 0.0,
30
- "do_sample": false,
31
  "dropout": 0.1,
32
- "early_stopping": false,
33
  "encoder_hidden_size": 32,
34
- "encoder_no_repeat_ngram_size": 0,
35
- "eos_token_id": null,
36
- "exponential_decay_length_penalty": null,
37
- "finetuning_task": null,
38
- "forced_bos_token_id": null,
39
- "forced_eos_token_id": null,
40
- "hidden_act": "gelu",
41
- "hidden_dropout_prob": 0.1,
42
  "hidden_size": 32,
43
- "id2label": {
44
- "0": "LABEL_0",
45
- "1": "LABEL_1"
46
- },
47
- "initializer_range": 0.02,
48
  "intermediate_size": 37,
49
- "is_decoder": false,
50
- "is_encoder_decoder": false,
51
- "label2id": {
52
- "LABEL_0": 0,
53
- "LABEL_1": 1
54
- },
55
- "layer_norm_eps": 1e-12,
56
- "length_penalty": 1.0,
57
- "max_length": 20,
58
- "max_position_embeddings": 512,
59
- "min_length": 0,
60
  "model_type": "blip_2_qformer",
61
- "no_repeat_ngram_size": 0,
62
  "num_attention_heads": 4,
63
- "num_beam_groups": 1,
64
- "num_beams": 1,
65
  "num_hidden_layers": 6,
66
- "num_return_sequences": 1,
67
- "output_attentions": false,
68
- "output_hidden_states": false,
69
- "output_scores": false,
70
- "pad_token_id": 0,
71
- "position_embedding_type": "absolute",
72
- "prefix": null,
73
- "problem_type": null,
74
  "projection_dim": 32,
75
- "pruned_heads": {},
76
- "remove_invalid_values": false,
77
- "repetition_penalty": 1.0,
78
- "return_dict": true,
79
- "return_dict_in_generate": false,
80
- "sep_token_id": null,
81
- "suppress_tokens": null,
82
- "task_specific_params": null,
83
- "temperature": 1.0,
84
- "tf_legacy_loss": false,
85
- "tie_encoder_decoder": false,
86
- "tie_word_embeddings": true,
87
- "tokenizer_class": null,
88
- "top_k": 50,
89
- "top_p": 1.0,
90
- "torch_dtype": null,
91
- "torchscript": false,
92
- "transformers_version": "4.27.0.dev0",
93
- "typical_p": 1.0,
94
- "use_bfloat16": false,
95
  "vocab_size": 99
96
  },
97
  "text_config": {
98
- "_name_or_path": "",
99
- "add_cross_attention": false,
100
- "architectures": null,
101
- "bad_words_ids": null,
102
- "begin_suppress_tokens": null,
103
  "bos_token_id": 0,
104
- "chunk_size_feed_forward": 0,
105
- "cross_attention_hidden_size": null,
106
  "d_ff": 37,
107
  "d_kv": 8,
108
  "d_model": 32,
109
  "decoder_start_token_id": 0,
110
  "dense_act_fn": "relu",
111
- "diversity_penalty": 0.0,
112
- "do_sample": false,
113
  "dropout_rate": 0.1,
114
- "early_stopping": false,
115
- "encoder_no_repeat_ngram_size": 0,
116
  "eos_token_id": 1,
117
- "exponential_decay_length_penalty": null,
118
  "feed_forward_proj": "relu",
119
- "finetuning_task": null,
120
- "forced_bos_token_id": null,
121
- "forced_eos_token_id": null,
122
- "id2label": {
123
- "0": "LABEL_0",
124
- "1": "LABEL_1"
125
- },
126
  "initializer_factor": 0.002,
127
- "is_decoder": false,
128
  "is_encoder_decoder": true,
129
  "is_gated_act": false,
130
- "label2id": {
131
- "LABEL_0": 0,
132
- "LABEL_1": 1
133
- },
134
  "layer_norm_epsilon": 1e-06,
135
- "length_penalty": 1.0,
136
- "max_length": 20,
137
- "min_length": 0,
138
  "model_type": "t5",
139
- "no_repeat_ngram_size": 0,
140
- "num_beam_groups": 1,
141
- "num_beams": 1,
142
  "num_decoder_layers": 5,
143
  "num_heads": 4,
144
  "num_layers": 5,
145
- "num_return_sequences": 1,
146
- "output_attentions": false,
147
- "output_hidden_states": false,
148
- "output_scores": false,
149
  "pad_token_id": 0,
150
- "prefix": null,
151
- "problem_type": null,
152
- "pruned_heads": {},
153
  "relative_attention_max_distance": 128,
154
  "relative_attention_num_buckets": 8,
155
- "remove_invalid_values": false,
156
- "repetition_penalty": 1.0,
157
- "return_dict": true,
158
- "return_dict_in_generate": false,
159
- "sep_token_id": null,
160
- "suppress_tokens": null,
161
- "task_specific_params": null,
162
- "temperature": 1.0,
163
- "tf_legacy_loss": false,
164
- "tie_encoder_decoder": false,
165
- "tie_word_embeddings": true,
166
- "tokenizer_class": null,
167
- "top_k": 50,
168
- "top_p": 1.0,
169
- "torch_dtype": null,
170
- "torchscript": false,
171
- "transformers_version": "4.27.0.dev0",
172
- "typical_p": 1.0,
173
- "use_bfloat16": false,
174
- "use_cache": true,
175
- "vocab_size": 1024
176
  },
177
  "torch_dtype": "float32",
178
- "transformers_version": null,
179
  "use_decoder_only_language_model": false,
180
  "vision_config": {
181
- "_name_or_path": "",
182
- "add_cross_attention": false,
183
- "architectures": null,
184
  "attention_dropout": 0.1,
185
- "bad_words_ids": null,
186
- "begin_suppress_tokens": null,
187
- "bos_token_id": null,
188
- "chunk_size_feed_forward": 0,
189
- "cross_attention_hidden_size": null,
190
- "decoder_start_token_id": null,
191
- "diversity_penalty": 0.0,
192
- "do_sample": false,
193
  "dropout": 0.1,
194
- "early_stopping": false,
195
- "encoder_no_repeat_ngram_size": 0,
196
- "eos_token_id": null,
197
- "exponential_decay_length_penalty": null,
198
- "finetuning_task": null,
199
- "forced_bos_token_id": null,
200
- "forced_eos_token_id": null,
201
- "hidden_act": "gelu",
202
  "hidden_size": 32,
203
- "id2label": {
204
- "0": "LABEL_0",
205
- "1": "LABEL_1"
206
- },
207
  "image_size": 30,
208
  "initializer_factor": 1.0,
209
- "initializer_range": 1e-10,
210
  "intermediate_size": 37,
211
- "is_decoder": false,
212
- "is_encoder_decoder": false,
213
- "label2id": {
214
- "LABEL_0": 0,
215
- "LABEL_1": 1
216
- },
217
  "layer_norm_eps": 1e-05,
218
- "length_penalty": 1.0,
219
- "max_length": 20,
220
- "min_length": 0,
221
  "model_type": "blip_2_vision_model",
222
- "no_repeat_ngram_size": 0,
223
  "num_attention_heads": 4,
224
- "num_beam_groups": 1,
225
- "num_beams": 1,
226
  "num_channels": 3,
227
  "num_hidden_layers": 5,
228
- "num_return_sequences": 1,
229
- "output_attentions": false,
230
- "output_hidden_states": false,
231
- "output_scores": false,
232
- "pad_token_id": null,
233
  "patch_size": 2,
234
- "prefix": null,
235
- "problem_type": null,
236
- "projection_dim": 32,
237
- "pruned_heads": {},
238
- "qkv_bias": true,
239
- "remove_invalid_values": false,
240
- "repetition_penalty": 1.0,
241
- "return_dict": true,
242
- "return_dict_in_generate": false,
243
- "sep_token_id": null,
244
- "suppress_tokens": null,
245
- "task_specific_params": null,
246
- "temperature": 1.0,
247
- "tf_legacy_loss": false,
248
- "tie_encoder_decoder": false,
249
- "tie_word_embeddings": true,
250
- "tokenizer_class": null,
251
- "top_k": 50,
252
- "top_p": 1.0,
253
- "torch_dtype": null,
254
- "torchscript": false,
255
- "transformers_version": "4.27.0.dev0",
256
- "typical_p": 1.0,
257
- "use_bfloat16": false
258
  }
259
  }
 
1
  {
2
+ "_name_or_path": "hf-internal-testing/tiny-random-Blip2ForConditionalGeneration",
3
  "architectures": [
4
  "Blip2ForConditionalGeneration"
5
  ],
6
  "bos_token_id": 1,
7
  "decoder_start_token_id": 0,
8
  "eos_token_id": 1,
9
+ "image_text_hidden_size": 256,
10
+ "image_token_index": 1024,
11
  "initializer_factor": 1.0,
12
  "initializer_range": 0.02,
13
  "is_encoder_decoder": true,
 
15
  "num_query_tokens": 10,
16
  "pad_token_id": 0,
17
  "qformer_config": {
18
+ "_attn_implementation_autoset": true,
 
 
19
  "attention_dropout": 0.1,
 
 
 
20
  "bos_token_id": 0,
 
21
  "classifier_dropout": null,
 
 
 
 
 
22
  "dropout": 0.1,
 
23
  "encoder_hidden_size": 32,
 
 
 
 
 
 
 
 
24
  "hidden_size": 32,
 
 
 
 
 
25
  "intermediate_size": 37,
 
 
 
 
 
 
 
 
 
 
 
26
  "model_type": "blip_2_qformer",
 
27
  "num_attention_heads": 4,
 
 
28
  "num_hidden_layers": 6,
 
 
 
 
 
 
 
 
29
  "projection_dim": 32,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  "vocab_size": 99
31
  },
32
  "text_config": {
 
 
 
 
 
33
  "bos_token_id": 0,
34
+ "classifier_dropout": 0.0,
 
35
  "d_ff": 37,
36
  "d_kv": 8,
37
  "d_model": 32,
38
  "decoder_start_token_id": 0,
39
  "dense_act_fn": "relu",
 
 
40
  "dropout_rate": 0.1,
 
 
41
  "eos_token_id": 1,
 
42
  "feed_forward_proj": "relu",
 
 
 
 
 
 
 
43
  "initializer_factor": 0.002,
 
44
  "is_encoder_decoder": true,
45
  "is_gated_act": false,
 
 
 
 
46
  "layer_norm_epsilon": 1e-06,
 
 
 
47
  "model_type": "t5",
 
 
 
48
  "num_decoder_layers": 5,
49
  "num_heads": 4,
50
  "num_layers": 5,
 
 
 
 
51
  "pad_token_id": 0,
 
 
 
52
  "relative_attention_max_distance": 128,
53
  "relative_attention_num_buckets": 8,
54
+ "vocab_size": 1088
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  },
56
  "torch_dtype": "float32",
57
+ "transformers_version": "4.47.0.dev0",
58
  "use_decoder_only_language_model": false,
59
  "vision_config": {
60
+ "_attn_implementation_autoset": true,
 
 
61
  "attention_dropout": 0.1,
 
 
 
 
 
 
 
 
62
  "dropout": 0.1,
 
 
 
 
 
 
 
 
63
  "hidden_size": 32,
 
 
 
 
64
  "image_size": 30,
65
  "initializer_factor": 1.0,
 
66
  "intermediate_size": 37,
 
 
 
 
 
 
67
  "layer_norm_eps": 1e-05,
 
 
 
68
  "model_type": "blip_2_vision_model",
 
69
  "num_attention_heads": 4,
 
 
70
  "num_channels": 3,
71
  "num_hidden_layers": 5,
 
 
 
 
 
72
  "patch_size": 2,
73
+ "projection_dim": 32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
  }
generation_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "decoder_start_token_id": 0,
5
+ "eos_token_id": 1,
6
+ "pad_token_id": 0,
7
+ "transformers_version": "4.47.0.dev0"
8
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb096ca18d04b1aa415e6bc5952d986fc01928573aa3160bb6851931a65f230b
3
+ size 906868