MAGAer13 commited on
Commit
d0485fb
1 Parent(s): c451238
README.md CHANGED
@@ -23,7 +23,7 @@ from transformers import AutoTokenizer
23
  from mplug_owl.modeling_mplug_owl import MplugOwlForConditionalGeneration
24
  from mplug_owl.processing_mplug_owl import MplugOwlImageProcessor, MplugOwlProcessor
25
 
26
- pretrained_ckpt = 'MAGAer13/mplug-owl-llama-7b'
27
  model = MplugOwlForConditionalGeneration.from_pretrained(
28
  pretrained_ckpt,
29
  torch_dtype=torch.bfloat16,
@@ -66,4 +66,4 @@ with torch.no_grad():
66
  res = model.generate(**inputs, **generate_kwargs)
67
  sentence = tokenizer.decode(res.tolist()[0], skip_special_tokens=True)
68
  print(sentence)
69
- ```
 
23
  from mplug_owl.modeling_mplug_owl import MplugOwlForConditionalGeneration
24
  from mplug_owl.processing_mplug_owl import MplugOwlImageProcessor, MplugOwlProcessor
25
 
26
+ pretrained_ckpt = 'MAGAer13/mplug-owl-bloomz-7b-multilingual'
27
  model = MplugOwlForConditionalGeneration.from_pretrained(
28
  pretrained_ckpt,
29
  torch_dtype=torch.bfloat16,
 
66
  res = model.generate(**inputs, **generate_kwargs)
67
  sentence = tokenizer.decode(res.tolist()[0], skip_special_tokens=True)
68
  print(sentence)
69
+ ```
config.json ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "return_dict": true,
3
+ "output_hidden_states": false,
4
+ "output_attentions": false,
5
+ "torchscript": false,
6
+ "torch_dtype": null,
7
+ "use_bfloat16": false,
8
+ "tf_legacy_loss": false,
9
+ "pruned_heads": {},
10
+ "tie_word_embeddings": false,
11
+ "is_encoder_decoder": false,
12
+ "is_decoder": false,
13
+ "cross_attention_hidden_size": null,
14
+ "add_cross_attention": false,
15
+ "tie_encoder_decoder": false,
16
+ "max_length": 20,
17
+ "min_length": 0,
18
+ "do_sample": false,
19
+ "early_stopping": false,
20
+ "num_beams": 1,
21
+ "num_beam_groups": 1,
22
+ "diversity_penalty": 0.0,
23
+ "temperature": 1.0,
24
+ "top_k": 50,
25
+ "top_p": 1.0,
26
+ "typical_p": 1.0,
27
+ "repetition_penalty": 1.0,
28
+ "length_penalty": 1.0,
29
+ "no_repeat_ngram_size": 0,
30
+ "encoder_no_repeat_ngram_size": 0,
31
+ "bad_words_ids": null,
32
+ "num_return_sequences": 1,
33
+ "chunk_size_feed_forward": 0,
34
+ "output_scores": false,
35
+ "return_dict_in_generate": false,
36
+ "forced_bos_token_id": null,
37
+ "forced_eos_token_id": null,
38
+ "remove_invalid_values": false,
39
+ "exponential_decay_length_penalty": null,
40
+ "suppress_tokens": null,
41
+ "begin_suppress_tokens": null,
42
+ "architectures": null,
43
+ "finetuning_task": null,
44
+ "id2label": {
45
+ "0": "LABEL_0",
46
+ "1": "LABEL_1"
47
+ },
48
+ "label2id": {
49
+ "LABEL_0": 0,
50
+ "LABEL_1": 1
51
+ },
52
+ "tokenizer_class": null,
53
+ "prefix": null,
54
+ "bos_token_id": null,
55
+ "pad_token_id": null,
56
+ "eos_token_id": null,
57
+ "sep_token_id": null,
58
+ "decoder_start_token_id": null,
59
+ "task_specific_params": null,
60
+ "problem_type": null,
61
+ "_name_or_path": "",
62
+ "_commit_hash": null,
63
+ "transformers_version": null,
64
+ "vision_config": {
65
+ "return_dict": true,
66
+ "output_hidden_states": false,
67
+ "output_attentions": false,
68
+ "torchscript": false,
69
+ "torch_dtype": null,
70
+ "use_bfloat16": false,
71
+ "tf_legacy_loss": false,
72
+ "pruned_heads": {},
73
+ "tie_word_embeddings": true,
74
+ "is_encoder_decoder": false,
75
+ "is_decoder": false,
76
+ "cross_attention_hidden_size": null,
77
+ "add_cross_attention": false,
78
+ "tie_encoder_decoder": false,
79
+ "max_length": 20,
80
+ "min_length": 0,
81
+ "do_sample": false,
82
+ "early_stopping": false,
83
+ "num_beams": 1,
84
+ "num_beam_groups": 1,
85
+ "diversity_penalty": 0.0,
86
+ "temperature": 1.0,
87
+ "top_k": 50,
88
+ "top_p": 1.0,
89
+ "typical_p": 1.0,
90
+ "repetition_penalty": 1.0,
91
+ "length_penalty": 1.0,
92
+ "no_repeat_ngram_size": 0,
93
+ "encoder_no_repeat_ngram_size": 0,
94
+ "bad_words_ids": null,
95
+ "num_return_sequences": 1,
96
+ "chunk_size_feed_forward": 0,
97
+ "output_scores": false,
98
+ "return_dict_in_generate": false,
99
+ "forced_bos_token_id": null,
100
+ "forced_eos_token_id": null,
101
+ "remove_invalid_values": false,
102
+ "exponential_decay_length_penalty": null,
103
+ "suppress_tokens": null,
104
+ "begin_suppress_tokens": null,
105
+ "architectures": null,
106
+ "finetuning_task": null,
107
+ "id2label": {
108
+ "0": "LABEL_0",
109
+ "1": "LABEL_1"
110
+ },
111
+ "label2id": {
112
+ "LABEL_0": 0,
113
+ "LABEL_1": 1
114
+ },
115
+ "tokenizer_class": null,
116
+ "prefix": null,
117
+ "bos_token_id": null,
118
+ "pad_token_id": null,
119
+ "eos_token_id": null,
120
+ "sep_token_id": null,
121
+ "decoder_start_token_id": null,
122
+ "task_specific_params": null,
123
+ "problem_type": null,
124
+ "_name_or_path": "",
125
+ "transformers_version": "4.29.0.dev0",
126
+ "model_type": "mplug_owl_vision_model",
127
+ "hidden_size": 1024,
128
+ "intermediate_size": 4096,
129
+ "projection_dim": 768,
130
+ "num_hidden_layers": 24,
131
+ "num_attention_heads": 16,
132
+ "num_channels": 3,
133
+ "patch_size": 14,
134
+ "image_size": 224,
135
+ "initializer_range": 0.02,
136
+ "initializer_factor": 1.0,
137
+ "attention_dropout": 0.0,
138
+ "layer_norm_eps": 1e-06,
139
+ "hidden_act": "quick_gelu"
140
+ },
141
+ "visual_abstractor_config": {
142
+ "return_dict": true,
143
+ "output_hidden_states": false,
144
+ "output_attentions": false,
145
+ "torchscript": false,
146
+ "torch_dtype": null,
147
+ "use_bfloat16": false,
148
+ "tf_legacy_loss": false,
149
+ "pruned_heads": {},
150
+ "tie_word_embeddings": true,
151
+ "is_encoder_decoder": false,
152
+ "is_decoder": false,
153
+ "cross_attention_hidden_size": null,
154
+ "add_cross_attention": false,
155
+ "tie_encoder_decoder": false,
156
+ "max_length": 20,
157
+ "min_length": 0,
158
+ "do_sample": false,
159
+ "early_stopping": false,
160
+ "num_beams": 1,
161
+ "num_beam_groups": 1,
162
+ "diversity_penalty": 0.0,
163
+ "temperature": 1.0,
164
+ "top_k": 50,
165
+ "top_p": 1.0,
166
+ "typical_p": 1.0,
167
+ "repetition_penalty": 1.0,
168
+ "length_penalty": 1.0,
169
+ "no_repeat_ngram_size": 0,
170
+ "encoder_no_repeat_ngram_size": 0,
171
+ "bad_words_ids": null,
172
+ "num_return_sequences": 1,
173
+ "chunk_size_feed_forward": 0,
174
+ "output_scores": false,
175
+ "return_dict_in_generate": false,
176
+ "forced_bos_token_id": null,
177
+ "forced_eos_token_id": null,
178
+ "remove_invalid_values": false,
179
+ "exponential_decay_length_penalty": null,
180
+ "suppress_tokens": null,
181
+ "begin_suppress_tokens": null,
182
+ "architectures": null,
183
+ "finetuning_task": null,
184
+ "id2label": {
185
+ "0": "LABEL_0",
186
+ "1": "LABEL_1"
187
+ },
188
+ "label2id": {
189
+ "LABEL_0": 0,
190
+ "LABEL_1": 1
191
+ },
192
+ "tokenizer_class": null,
193
+ "prefix": null,
194
+ "bos_token_id": null,
195
+ "pad_token_id": 0,
196
+ "eos_token_id": null,
197
+ "sep_token_id": null,
198
+ "decoder_start_token_id": null,
199
+ "task_specific_params": null,
200
+ "problem_type": null,
201
+ "_name_or_path": "",
202
+ "transformers_version": "4.29.0.dev0",
203
+ "vocab_size": 30522,
204
+ "hidden_size": 1024,
205
+ "num_hidden_layers": 6,
206
+ "num_attention_heads": 16,
207
+ "hidden_act": "gelu",
208
+ "intermediate_size": 4096,
209
+ "hidden_dropout_prob": 0.1,
210
+ "attention_probs_dropout_prob": 0.1,
211
+ "max_position_embeddings": 512,
212
+ "initializer_range": 0.02,
213
+ "layer_norm_eps": 1e-06,
214
+ "position_embedding_type": "absolute",
215
+ "classifier_dropout": null,
216
+ "cross_attention_frequency": 2,
217
+ "encoder_hidden_size": 1024,
218
+ "model_type": "MPlugOwlVisualAbstractor"
219
+ },
220
+ "text_config": {
221
+ "apply_residual_connection_post_layernorm": false,
222
+ "attention_dropout": 0.0,
223
+ "attention_softmax_in_fp32": true,
224
+ "bias_dropout_fusion": true,
225
+ "bos_token_id": 1,
226
+ "eos_token_id": 2,
227
+ "hidden_dropout": 0.0,
228
+ "initializer_range": 0.02,
229
+ "layer_norm_epsilon": 1e-05,
230
+ "masked_softmax_fusion": true,
231
+ "model_type": "bloom",
232
+ "n_embed": 4096,
233
+ "n_inner": null,
234
+ "n_layer": 30,
235
+ "num_attention_heads": 32,
236
+ "offset_alibi": 100,
237
+ "pad_token_id": 3,
238
+ "pretraining_tp": 4,
239
+ "seq_length": 2048,
240
+ "skip_bias_add": true,
241
+ "skip_bias_add_qkv": false,
242
+ "slow_but_exact": false,
243
+ "transformers_version": "4.21.0.dev0",
244
+ "unk_token_id": 0,
245
+ "use_cache": true,
246
+ "vocab_size": 250880
247
+ },
248
+ "num_query_tokens": 64,
249
+ "use_decoder_only_language_model": true,
250
+ "initializer_factor": 1.0,
251
+ "initializer_range": 0.02,
252
+ "model_type": "mplug-owl"
253
+ }
generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "do_sample": true,
4
+ "eos_token_id": 2,
5
+ "max_length": 512,
6
+ "pad_token_id": 0,
7
+ "top_k": 3,
8
+ "transformers_version": "4.29.0.dev0",
9
+ "unk_token_id": 0
10
+ }
11
+
preprocessor_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "resolution": 224,
3
+ "image_mean": [
4
+ 0.48145466, 0.4578275, 0.40821073
5
+ ],
6
+ "image_std": [
7
+ 0.26862954, 0.26130258, 0.27577711
8
+ ]
9
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02ddb80deb7427199ac967891cbe5c2ead3254f56fdea690d310249613547d00
3
+ size 14907607673
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>"}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "<unk>", "eos_token": "</s>", "bos_token": "<s>", "pad_token": "<pad>", "name_or_path": "bigscience/tokenizer", "special_tokens_map_file": null, "tokenizer_class": "BloomTokenizerFast", "padding_side": "left"}