jcrbsa commited on
Commit
2e54776
1 Parent(s): f54085d

First Commit

Browse files
README(1).md ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
README.md CHANGED
@@ -1,3 +1,10 @@
1
  ---
2
- license: mit
 
3
  ---
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - pt
4
  ---
5
+
6
+ Image Captioning in Portuguese trained with ViT and GPT2
7
+
8
+ [DEMO](https://huggingface.co/spaces/adalbertojunior/image_captioning_portuguese)
9
+
10
+ Research supported with Cloud TPUs from Google's TPU Research Cloud (TRC)
config.json ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "./",
3
+ "architectures": [
4
+ "VisionEncoderDecoderModel"
5
+ ],
6
+ "decoder": {
7
+ "_name_or_path": "pierreguillou/gpt2-small-portuguese",
8
+ "activation_function": "gelu_new",
9
+ "add_cross_attention": true,
10
+ "architectures": [
11
+ "GPT2LMHeadModel"
12
+ ],
13
+ "attn_pdrop": 0.1,
14
+ "bad_words_ids": null,
15
+ "bos_token_id": 50256,
16
+ "chunk_size_feed_forward": 0,
17
+ "cross_attention_hidden_size": null,
18
+ "decoder_start_token_id": null,
19
+ "diversity_penalty": 0.0,
20
+ "do_sample": false,
21
+ "early_stopping": false,
22
+ "embd_pdrop": 0.1,
23
+ "encoder_no_repeat_ngram_size": 0,
24
+ "eos_token_id": 50256,
25
+ "finetuning_task": null,
26
+ "forced_bos_token_id": null,
27
+ "forced_eos_token_id": null,
28
+ "id2label": {
29
+ "0": "LABEL_0",
30
+ "1": "LABEL_1"
31
+ },
32
+ "initializer_range": 0.02,
33
+ "is_decoder": true,
34
+ "is_encoder_decoder": false,
35
+ "label2id": {
36
+ "LABEL_0": 0,
37
+ "LABEL_1": 1
38
+ },
39
+ "layer_norm_epsilon": 1e-05,
40
+ "length_penalty": 1.0,
41
+ "max_length": 20,
42
+ "min_length": 0,
43
+ "model_type": "gpt2",
44
+ "n_ctx": 1024,
45
+ "n_embd": 768,
46
+ "n_head": 12,
47
+ "n_inner": null,
48
+ "n_layer": 12,
49
+ "n_positions": 1024,
50
+ "no_repeat_ngram_size": 0,
51
+ "num_beam_groups": 1,
52
+ "num_beams": 1,
53
+ "num_return_sequences": 1,
54
+ "output_attentions": false,
55
+ "output_hidden_states": false,
56
+ "output_scores": false,
57
+ "pad_token_id": null,
58
+ "prefix": null,
59
+ "problem_type": null,
60
+ "pruned_heads": {},
61
+ "remove_invalid_values": false,
62
+ "reorder_and_upcast_attn": false,
63
+ "repetition_penalty": 1.0,
64
+ "resid_pdrop": 0.1,
65
+ "return_dict": true,
66
+ "return_dict_in_generate": false,
67
+ "scale_attn_by_inverse_layer_idx": false,
68
+ "scale_attn_weights": true,
69
+ "sep_token_id": null,
70
+ "summary_activation": null,
71
+ "summary_first_dropout": 0.1,
72
+ "summary_proj_to_labels": true,
73
+ "summary_type": "cls_index",
74
+ "summary_use_proj": true,
75
+ "task_specific_params": {
76
+ "text-generation": {
77
+ "do_sample": true,
78
+ "max_length": 50
79
+ }
80
+ },
81
+ "temperature": 1.0,
82
+ "tie_encoder_decoder": false,
83
+ "tie_word_embeddings": true,
84
+ "tokenizer_class": null,
85
+ "top_k": 50,
86
+ "top_p": 1.0,
87
+ "torch_dtype": null,
88
+ "torchscript": false,
89
+ "transformers_version": "4.14.1",
90
+ "use_bfloat16": false,
91
+ "use_cache": true,
92
+ "vocab_size": 50257
93
+ },
94
+ "decoder_start_token_id": 50256,
95
+ "encoder": {
96
+ "_name_or_path": "google/vit-base-patch16-224-in21k",
97
+ "add_cross_attention": false,
98
+ "architectures": [
99
+ "ViTModel"
100
+ ],
101
+ "attention_probs_dropout_prob": 0.0,
102
+ "bad_words_ids": null,
103
+ "bos_token_id": null,
104
+ "chunk_size_feed_forward": 0,
105
+ "cross_attention_hidden_size": null,
106
+ "decoder_start_token_id": null,
107
+ "diversity_penalty": 0.0,
108
+ "do_sample": false,
109
+ "early_stopping": false,
110
+ "encoder_no_repeat_ngram_size": 0,
111
+ "eos_token_id": null,
112
+ "finetuning_task": null,
113
+ "forced_bos_token_id": null,
114
+ "forced_eos_token_id": null,
115
+ "hidden_act": "gelu",
116
+ "hidden_dropout_prob": 0.0,
117
+ "hidden_size": 768,
118
+ "id2label": {
119
+ "0": "LABEL_0",
120
+ "1": "LABEL_1"
121
+ },
122
+ "image_size": 224,
123
+ "initializer_range": 0.02,
124
+ "intermediate_size": 3072,
125
+ "is_decoder": false,
126
+ "is_encoder_decoder": false,
127
+ "label2id": {
128
+ "LABEL_0": 0,
129
+ "LABEL_1": 1
130
+ },
131
+ "layer_norm_eps": 1e-12,
132
+ "length_penalty": 1.0,
133
+ "max_length": 20,
134
+ "min_length": 0,
135
+ "model_type": "vit",
136
+ "no_repeat_ngram_size": 0,
137
+ "num_attention_heads": 12,
138
+ "num_beam_groups": 1,
139
+ "num_beams": 1,
140
+ "num_channels": 3,
141
+ "num_hidden_layers": 12,
142
+ "num_return_sequences": 1,
143
+ "output_attentions": false,
144
+ "output_hidden_states": false,
145
+ "output_scores": false,
146
+ "pad_token_id": null,
147
+ "patch_size": 16,
148
+ "prefix": null,
149
+ "problem_type": null,
150
+ "pruned_heads": {},
151
+ "qkv_bias": true,
152
+ "remove_invalid_values": false,
153
+ "repetition_penalty": 1.0,
154
+ "return_dict": true,
155
+ "return_dict_in_generate": false,
156
+ "sep_token_id": null,
157
+ "task_specific_params": null,
158
+ "temperature": 1.0,
159
+ "tie_encoder_decoder": false,
160
+ "tie_word_embeddings": true,
161
+ "tokenizer_class": null,
162
+ "top_k": 50,
163
+ "top_p": 1.0,
164
+ "torch_dtype": null,
165
+ "torchscript": false,
166
+ "transformers_version": "4.14.1",
167
+ "use_bfloat16": false
168
+ },
169
+ "eos_token_id": 50256,
170
+ "is_encoder_decoder": true,
171
+ "model_type": "vision-encoder-decoder",
172
+ "pad_token_id": 50256,
173
+ "tie_word_embeddings": false,
174
+ "torch_dtype": "float32",
175
+ "transformers_version": null
176
+ }
eval_generation.json ADDED
The diff for this file is too large to render. See raw diff
eval_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "eval_gen_len": 31.0,
3
+ "eval_loss": 1.898256,
4
+ "eval_rouge1": 35.430785,
5
+ "eval_rouge2": 15.561317,
6
+ "eval_rougeL": 31.789423,
7
+ "eval_rougeLsum": 31.568673
8
+ }
flax_model.msgpack ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7c9124fe3adaf62e207f6c751659842b56f762770e898af36f5e8b3667614e9
3
+ size 956799284
merges.txt ADDED
The diff for this file is too large to render. See raw diff
preprocessor_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_resize": true,
4
+ "feature_extractor_type": "ViTFeatureExtractor",
5
+ "image_mean": [
6
+ 0.5,
7
+ 0.5,
8
+ 0.5
9
+ ],
10
+ "image_std": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "resample": 2,
16
+ "size": 224
17
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:447130d85cb73b8d14c048fe1af48b47a4e4464f100cfeb9aa8cb0849bfbefde
3
+ size 982141855
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>", "pad_token": "ĠOlivais"}
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": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "bos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": false, "pad_token": "<|endoftext|>", "special_tokens_map_file": null, "full_tokenizer_file": null, "name_or_path": "model", "errors": "replace", "tokenizer_class": "GPT2Tokenizer"}