ayushtues commited on
Commit
2a8458a
·
1 Parent(s): 19f7956
model_index.json CHANGED
@@ -1,13 +1,17 @@
1
  {
2
  "_class_name": "BlipDiffusionPipeline",
3
  "_diffusers_version": "0.18.0.dev0",
 
 
 
 
4
  "scheduler": [
5
  "diffusers",
6
- "DDPMScheduler"
7
  ],
8
  "text_encoder": [
9
- null,
10
- null
11
  ],
12
  "tokenizer": [
13
  "transformers",
@@ -20,9 +24,5 @@
20
  "vae": [
21
  "diffusers",
22
  "AutoencoderKL"
23
- ],
24
- "vision_encoder": [
25
- "src.diffusers.pipelines.blip_diffusion.modeling_blip2",
26
- "Blip2VisionModel"
27
  ]
28
  }
 
1
  {
2
  "_class_name": "BlipDiffusionPipeline",
3
  "_diffusers_version": "0.18.0.dev0",
4
+ "qformer": [
5
+ "src.diffusers.pipelines.blip_diffusion.modeling_blip2",
6
+ "Blip2QFormerModel"
7
+ ],
8
  "scheduler": [
9
  "diffusers",
10
+ "PNDMScheduler"
11
  ],
12
  "text_encoder": [
13
+ "src.diffusers.pipelines.blip_diffusion.modeling_ctx_clip",
14
+ "CtxCLIPTextModel"
15
  ],
16
  "tokenizer": [
17
  "transformers",
 
24
  "vae": [
25
  "diffusers",
26
  "AutoencoderKL"
 
 
 
 
27
  ]
28
  }
qformer/config.json ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_commit_hash": null,
3
+ "_name_or_path": "./blip2diffusion/qformer",
4
+ "architectures": [
5
+ "Blip2QFormerModel"
6
+ ],
7
+ "initializer_factor": 1.0,
8
+ "initializer_range": 0.02,
9
+ "model_type": "blip-2",
10
+ "num_query_tokens": 16,
11
+ "qformer_config": {
12
+ "_name_or_path": "",
13
+ "add_cross_attention": false,
14
+ "architectures": null,
15
+ "attention_probs_dropout_prob": 0.1,
16
+ "bad_words_ids": null,
17
+ "begin_suppress_tokens": null,
18
+ "bos_token_id": null,
19
+ "chunk_size_feed_forward": 0,
20
+ "cross_attention_frequency": 1,
21
+ "cross_attention_hidden_size": null,
22
+ "decoder_start_token_id": null,
23
+ "diversity_penalty": 0.0,
24
+ "do_sample": false,
25
+ "early_stopping": false,
26
+ "encoder_hidden_size": 1024,
27
+ "encoder_no_repeat_ngram_size": 0,
28
+ "eos_token_id": null,
29
+ "exponential_decay_length_penalty": null,
30
+ "finetuning_task": null,
31
+ "forced_bos_token_id": null,
32
+ "forced_eos_token_id": null,
33
+ "hidden_act": "gelu",
34
+ "hidden_dropout_prob": 0.1,
35
+ "hidden_size": 768,
36
+ "id2label": {
37
+ "0": "LABEL_0",
38
+ "1": "LABEL_1"
39
+ },
40
+ "initializer_range": 0.02,
41
+ "intermediate_size": 3072,
42
+ "is_decoder": false,
43
+ "is_encoder_decoder": false,
44
+ "label2id": {
45
+ "LABEL_0": 0,
46
+ "LABEL_1": 1
47
+ },
48
+ "layer_norm_eps": 1e-12,
49
+ "length_penalty": 1.0,
50
+ "max_length": 20,
51
+ "max_position_embeddings": 512,
52
+ "min_length": 0,
53
+ "model_type": "blip_2_qformer",
54
+ "no_repeat_ngram_size": 0,
55
+ "num_attention_heads": 12,
56
+ "num_beam_groups": 1,
57
+ "num_beams": 1,
58
+ "num_hidden_layers": 12,
59
+ "num_return_sequences": 1,
60
+ "output_attentions": false,
61
+ "output_hidden_states": false,
62
+ "output_scores": false,
63
+ "pad_token_id": 0,
64
+ "position_embedding_type": "absolute",
65
+ "prefix": null,
66
+ "problem_type": null,
67
+ "pruned_heads": {},
68
+ "remove_invalid_values": false,
69
+ "repetition_penalty": 1.0,
70
+ "return_dict": true,
71
+ "return_dict_in_generate": false,
72
+ "sep_token_id": null,
73
+ "suppress_tokens": null,
74
+ "task_specific_params": null,
75
+ "temperature": 1.0,
76
+ "tf_legacy_loss": false,
77
+ "tie_encoder_decoder": false,
78
+ "tie_word_embeddings": true,
79
+ "tokenizer_class": null,
80
+ "top_k": 50,
81
+ "top_p": 1.0,
82
+ "torch_dtype": null,
83
+ "torchscript": false,
84
+ "transformers_version": "4.31.0",
85
+ "typical_p": 1.0,
86
+ "use_bfloat16": false,
87
+ "vocab_size": 30523
88
+ },
89
+ "text_config": {
90
+ "_name_or_path": "",
91
+ "_remove_final_layer_norm": false,
92
+ "activation_function": "relu",
93
+ "add_cross_attention": false,
94
+ "architectures": null,
95
+ "attention_dropout": 0.0,
96
+ "bad_words_ids": null,
97
+ "begin_suppress_tokens": null,
98
+ "bos_token_id": 2,
99
+ "chunk_size_feed_forward": 0,
100
+ "cross_attention_hidden_size": null,
101
+ "decoder_start_token_id": null,
102
+ "diversity_penalty": 0.0,
103
+ "do_layer_norm_before": true,
104
+ "do_sample": false,
105
+ "dropout": 0.1,
106
+ "early_stopping": false,
107
+ "enable_bias": true,
108
+ "encoder_no_repeat_ngram_size": 0,
109
+ "eos_token_id": 2,
110
+ "exponential_decay_length_penalty": null,
111
+ "ffn_dim": 3072,
112
+ "finetuning_task": null,
113
+ "forced_bos_token_id": null,
114
+ "forced_eos_token_id": null,
115
+ "hidden_size": 768,
116
+ "id2label": {
117
+ "0": "LABEL_0",
118
+ "1": "LABEL_1"
119
+ },
120
+ "init_std": 0.02,
121
+ "is_decoder": false,
122
+ "is_encoder_decoder": false,
123
+ "label2id": {
124
+ "LABEL_0": 0,
125
+ "LABEL_1": 1
126
+ },
127
+ "layer_norm_elementwise_affine": true,
128
+ "layerdrop": 0.0,
129
+ "length_penalty": 1.0,
130
+ "max_length": 20,
131
+ "max_position_embeddings": 2048,
132
+ "min_length": 0,
133
+ "model_type": "opt",
134
+ "no_repeat_ngram_size": 0,
135
+ "num_attention_heads": 12,
136
+ "num_beam_groups": 1,
137
+ "num_beams": 1,
138
+ "num_hidden_layers": 12,
139
+ "num_return_sequences": 1,
140
+ "output_attentions": false,
141
+ "output_hidden_states": false,
142
+ "output_scores": false,
143
+ "pad_token_id": 1,
144
+ "prefix": null,
145
+ "problem_type": null,
146
+ "pruned_heads": {},
147
+ "remove_invalid_values": false,
148
+ "repetition_penalty": 1.0,
149
+ "return_dict": true,
150
+ "return_dict_in_generate": false,
151
+ "sep_token_id": null,
152
+ "suppress_tokens": null,
153
+ "task_specific_params": null,
154
+ "temperature": 1.0,
155
+ "tf_legacy_loss": false,
156
+ "tie_encoder_decoder": false,
157
+ "tie_word_embeddings": true,
158
+ "tokenizer_class": null,
159
+ "top_k": 50,
160
+ "top_p": 1.0,
161
+ "torch_dtype": null,
162
+ "torchscript": false,
163
+ "transformers_version": "4.31.0",
164
+ "typical_p": 1.0,
165
+ "use_bfloat16": false,
166
+ "use_cache": true,
167
+ "vocab_size": 50272,
168
+ "word_embed_proj_dim": 768
169
+ },
170
+ "torch_dtype": "float32",
171
+ "transformers_version": null,
172
+ "use_decoder_only_language_model": true,
173
+ "vision_config": {
174
+ "_name_or_path": "",
175
+ "add_cross_attention": false,
176
+ "architectures": null,
177
+ "attention_dropout": 0.0,
178
+ "bad_words_ids": null,
179
+ "begin_suppress_tokens": null,
180
+ "bos_token_id": null,
181
+ "chunk_size_feed_forward": 0,
182
+ "cross_attention_hidden_size": null,
183
+ "decoder_start_token_id": null,
184
+ "diversity_penalty": 0.0,
185
+ "do_sample": false,
186
+ "early_stopping": false,
187
+ "encoder_no_repeat_ngram_size": 0,
188
+ "eos_token_id": null,
189
+ "exponential_decay_length_penalty": null,
190
+ "finetuning_task": null,
191
+ "forced_bos_token_id": null,
192
+ "forced_eos_token_id": null,
193
+ "hidden_act": "quick_gelu",
194
+ "hidden_size": 1024,
195
+ "id2label": {
196
+ "0": "LABEL_0",
197
+ "1": "LABEL_1"
198
+ },
199
+ "image_size": 224,
200
+ "initializer_range": 1e-10,
201
+ "intermediate_size": 4096,
202
+ "is_decoder": false,
203
+ "is_encoder_decoder": false,
204
+ "label2id": {
205
+ "LABEL_0": 0,
206
+ "LABEL_1": 1
207
+ },
208
+ "layer_norm_eps": 1e-05,
209
+ "length_penalty": 1.0,
210
+ "max_length": 20,
211
+ "min_length": 0,
212
+ "model_type": "blip_2_vision_model",
213
+ "no_repeat_ngram_size": 0,
214
+ "num_attention_heads": 16,
215
+ "num_beam_groups": 1,
216
+ "num_beams": 1,
217
+ "num_hidden_layers": 23,
218
+ "num_return_sequences": 1,
219
+ "output_attentions": false,
220
+ "output_hidden_states": false,
221
+ "output_scores": false,
222
+ "pad_token_id": null,
223
+ "patch_size": 14,
224
+ "prefix": null,
225
+ "problem_type": null,
226
+ "pruned_heads": {},
227
+ "qkv_bias": true,
228
+ "remove_invalid_values": false,
229
+ "repetition_penalty": 1.0,
230
+ "return_dict": true,
231
+ "return_dict_in_generate": false,
232
+ "sep_token_id": null,
233
+ "suppress_tokens": null,
234
+ "task_specific_params": null,
235
+ "temperature": 1.0,
236
+ "tf_legacy_loss": false,
237
+ "tie_encoder_decoder": false,
238
+ "tie_word_embeddings": true,
239
+ "tokenizer_class": null,
240
+ "top_k": 50,
241
+ "top_p": 1.0,
242
+ "torch_dtype": null,
243
+ "torchscript": false,
244
+ "transformers_version": "4.31.0",
245
+ "typical_p": 1.0,
246
+ "use_bfloat16": false
247
+ }
248
+ }
qformer/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:709f641c6a2b4a932c51e57f14ebcb3b270efd9bbf31db0c34af7c208aa06bc6
3
+ size 1976162665
scheduler/scheduler_config.json CHANGED
@@ -1,19 +1,13 @@
1
  {
2
- "_class_name": "DDPMScheduler",
3
  "_diffusers_version": "0.16.0",
4
  "beta_end": 0.012,
5
  "beta_schedule": "scaled_linear",
6
  "beta_start": 0.00085,
7
- "clip_sample": false,
8
- "clip_sample_range": 1.0,
9
- "dynamic_thresholding_ratio": 0.995,
10
  "num_train_timesteps": 1000,
11
  "prediction_type": "epsilon",
12
- "sample_max_value": 1.0,
13
  "set_alpha_to_one": false,
14
  "skip_prk_steps": true,
15
- "steps_offset": 1,
16
- "thresholding": false,
17
- "trained_betas": null,
18
- "variance_type": "fixed_small"
19
  }
 
1
  {
2
+ "_class_name": "PNDMScheduler",
3
  "_diffusers_version": "0.16.0",
4
  "beta_end": 0.012,
5
  "beta_schedule": "scaled_linear",
6
  "beta_start": 0.00085,
 
 
 
7
  "num_train_timesteps": 1000,
8
  "prediction_type": "epsilon",
 
9
  "set_alpha_to_one": false,
10
  "skip_prk_steps": true,
11
+ "steps_offset": 0,
12
+ "trained_betas": null
 
 
13
  }
text_encoder/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "./blipdiffusion_hf_ckpt/text_encoder",
3
+ "architectures": [
4
+ "CtxCLIPTextModel"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 0,
8
+ "dropout": 0.0,
9
+ "eos_token_id": 2,
10
+ "hidden_act": "quick_gelu",
11
+ "hidden_size": 768,
12
+ "initializer_factor": 1.0,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "layer_norm_eps": 1e-05,
16
+ "max_position_embeddings": 77,
17
+ "model_type": "clip_text_model",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 12,
20
+ "pad_token_id": 1,
21
+ "projection_dim": 768,
22
+ "torch_dtype": "float32",
23
+ "transformers_version": "4.31.0",
24
+ "vocab_size": 49408
25
+ }
text_encoder/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b374042419b2a5a28e7ee94503ff233719c7bd1345f5896ad982fdeff7c8cccc
3
+ size 492307041
unet/config.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "_class_name": "UNet2DConditionModel",
3
  "_diffusers_version": "0.16.0",
4
- "_name_or_path": "runwayml/stable-diffusion-v1-5",
5
  "act_fn": "silu",
6
  "addition_embed_type": null,
7
  "addition_embed_type_num_heads": 64,
 
1
  {
2
  "_class_name": "UNet2DConditionModel",
3
  "_diffusers_version": "0.16.0",
4
+ "_name_or_path": "./blipdiffusion_hf_ckpt/",
5
  "act_fn": "silu",
6
  "addition_embed_type": null,
7
  "addition_embed_type_num_heads": 64,
unet/diffusion_pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ebd8473673dfd403816acf5f09aa901c033246af9f6a3c62f3dd2580b78c8365
3
  size 3438366373
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c42d7cf4e4f028e3c955e13f4406231c946b602329de281b67c214f5efcb5137
3
  size 3438366373
vae/config.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "_class_name": "AutoencoderKL",
3
  "_diffusers_version": "0.16.0",
4
- "_name_or_path": "runwayml/stable-diffusion-v1-5",
5
  "act_fn": "silu",
6
  "block_out_channels": [
7
  128,
 
1
  {
2
  "_class_name": "AutoencoderKL",
3
  "_diffusers_version": "0.16.0",
4
+ "_name_or_path": "./blipdiffusion_hf_ckpt/",
5
  "act_fn": "silu",
6
  "block_out_channels": [
7
  128,