niobures commited on
Commit
7875e2e
·
verified ·
1 Parent(s): 4ed8b27

git-base, git-large

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +35 -35
  2. ConversionScripts.txt +2 -0
  3. GenerativeImage2Text.zip +3 -0
  4. VideoCaptioning.txt +2 -0
  5. forks/GIT [Velcorn] +5 -16.zip +3 -0
  6. forks/GIT_COCO-GenerativeImage2TextModel [Samiksha0108] +10.zip +3 -0
  7. forks/GIT_COCO-GenerativeImage2TextModel [THANKSHANK] +7.zip +3 -0
  8. forks/GenerativeImage2Text [NielsRogge] (understanding_generative +21 -16).zip +3 -0
  9. forks/GenerativeImage2Text [TanmayAmbadkar] +9 -16.zip +3 -0
  10. forks/GenerativeImage2Text [YANG-H] +3 -2.zip +3 -0
  11. forks/GenerativeImage2Text [ZhanqiZhang66] +8 -17.zip +3 -0
  12. forks/GenerativeImage2Text [alceballosa] +1 -19.zip +3 -0
  13. forks/GenerativeImage2Text [ascott02] +2 -19.zip +3 -0
  14. forks/GenerativeImage2Text [yqy2001] +2 -5.zip +3 -0
  15. models/git-base-coco/.gitattributes +34 -0
  16. models/git-base-coco/README.md +67 -0
  17. models/git-base-coco/config.json +106 -0
  18. models/git-base-coco/generation_config.json +7 -0
  19. models/git-base-coco/preprocessor_config.json +28 -0
  20. models/git-base-coco/pytorch_model.bin +3 -0
  21. models/git-base-coco/special_tokens_map.json +7 -0
  22. models/git-base-coco/tokenizer.json +0 -0
  23. models/git-base-coco/tokenizer_config.json +19 -0
  24. models/git-base-coco/vocab.txt +0 -0
  25. models/git-base-vatex/.gitattributes +34 -0
  26. models/git-base-vatex/README.md +66 -0
  27. models/git-base-vatex/config.json +106 -0
  28. models/git-base-vatex/generation_config.json +7 -0
  29. models/git-base-vatex/model.safetensors +3 -0
  30. models/git-base-vatex/preprocessor_config.json +27 -0
  31. models/git-base-vatex/pytorch_model.bin +3 -0
  32. models/git-base-vatex/special_tokens_map.json +7 -0
  33. models/git-base-vatex/tokenizer.json +0 -0
  34. models/git-base-vatex/tokenizer_config.json +19 -0
  35. models/git-base-vatex/vocab.txt +0 -0
  36. models/git-base-vqav2/.gitattributes +34 -0
  37. models/git-base-vqav2/README.md +67 -0
  38. models/git-base-vqav2/config.json +106 -0
  39. models/git-base-vqav2/generation_config.json +7 -0
  40. models/git-base-vqav2/model.safetensors +3 -0
  41. models/git-base-vqav2/preprocessor_config.json +28 -0
  42. models/git-base-vqav2/pytorch_model.bin +3 -0
  43. models/git-base-vqav2/special_tokens_map.json +7 -0
  44. models/git-base-vqav2/tokenizer.json +0 -0
  45. models/git-base-vqav2/tokenizer_config.json +19 -0
  46. models/git-base-vqav2/vocab.txt +0 -0
  47. models/git-base/.gitattributes +34 -0
  48. models/git-base/README.md +66 -0
  49. models/git-base/config.json +106 -0
  50. models/git-base/generation_config.json +7 -0
.gitattributes CHANGED
@@ -1,35 +1,35 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
ConversionScripts.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [08.12.2024] Q: Are the checkpoints provided here compatible with the architecture found at https://github.com/microsoft/GenerativeImage2Text or do they need some kind of modification?
2
+ A: Yes the checkpoints were ported from there. See the conversion script (used to convert them from the original repository to the Transformers format) here: https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/convert_git_to_pytorch.py
GenerativeImage2Text.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfd932ab32c9283b30e5cd682be2537b72c8a461a16e1fdce01010081d4029e4
3
+ size 1038163
VideoCaptioning.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [12.04.2024] Q: I have tried to run this model for video captioning. However, it only returns a caption for each frame. In the original paper, the model supports video through multiple frames. Is this support at HuggingFace as well?
2
+ A: For video captioning I'd recommend taking a look at the GIT checkpoints fine-tuned on video datasets, like https://huggingface.co/microsoft/git-base-vatex
forks/GIT [Velcorn] +5 -16.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c77bddbed63d76d8195aeba54521b5fe938c89e77a1c2f8ae36db09732c78095
3
+ size 1290200
forks/GIT_COCO-GenerativeImage2TextModel [Samiksha0108] +10.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:060d63a1a899d91a2122fc692a8dceca3e1c19ece37919bf3d357bcb0aa05801
3
+ size 76448278
forks/GIT_COCO-GenerativeImage2TextModel [THANKSHANK] +7.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4435403bcca78fe98e4bfacd3e1ad6dda8b7bc5beca91c46bbc8c6a51d9ec90
3
+ size 74461885
forks/GenerativeImage2Text [NielsRogge] (understanding_generative +21 -16).zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:140bc721fdf4f83c083904f8cc358fef5f194d5e3322331d599dc0c3e579b7e9
3
+ size 1032428
forks/GenerativeImage2Text [TanmayAmbadkar] +9 -16.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc1cad71c8678cc55b911d1f6be2da3a6539bcfe93a0ec0518887a5d559936f8
3
+ size 1615381
forks/GenerativeImage2Text [YANG-H] +3 -2.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9937223ab1d7b38c7b96a48265dd78984c58640255533faf56e7c34f7d4988e5
3
+ size 1036817
forks/GenerativeImage2Text [ZhanqiZhang66] +8 -17.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb1f1e28ff6691979643c6e5dca10d499808555e9e2e43e0a690634a26845ee8
3
+ size 1055913
forks/GenerativeImage2Text [alceballosa] +1 -19.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66c8ebc39584542e0ec922295aa9c785b8871da1ced53f81c25b9033598d3a89
3
+ size 1675961
forks/GenerativeImage2Text [ascott02] +2 -19.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:feab59625287aec17589de7855a246a3a73e601f12f1cdf5176bc6668739e128
3
+ size 1019772
forks/GenerativeImage2Text [yqy2001] +2 -5.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe08403ca36db662ab59a07b472dd6e39ca5fa0b0c54a6153d3d05c5e41975eb
3
+ size 1030408
models/git-base-coco/.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/git-base-coco/README.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ tags:
5
+ - vision
6
+ - image-captioning
7
+ model_name: microsoft/git-base-coco
8
+ pipeline_tag: image-to-text
9
+ ---
10
+
11
+ # GIT (GenerativeImage2Text), base-sized, fine-tuned on COCO
12
+
13
+ GIT (short for GenerativeImage2Text) model, base-sized version, fine-tuned on COCO. It was introduced in the paper [GIT: A Generative Image-to-text Transformer for Vision and Language](https://arxiv.org/abs/2205.14100) by Wang et al. and first released in [this repository](https://github.com/microsoft/GenerativeImage2Text).
14
+
15
+ Disclaimer: The team releasing GIT did not write a model card for this model so this model card has been written by the Hugging Face team.
16
+
17
+ ## Model description
18
+
19
+ GIT is a Transformer decoder conditioned on both CLIP image tokens and text tokens. The model is trained using "teacher forcing" on a lot of (image, text) pairs.
20
+
21
+ The goal for the model is simply to predict the next text token, giving the image tokens and previous text tokens.
22
+
23
+ The model has full access to (i.e. a bidirectional attention mask is used for) the image patch tokens, but only has access to the previous text tokens (i.e. a causal attention mask is used for the text tokens) when predicting the next text token.
24
+
25
+ ![GIT architecture](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/git_architecture.jpg)
26
+
27
+ This allows the model to be used for tasks like:
28
+
29
+ - image and video captioning
30
+ - visual question answering (VQA) on images and videos
31
+ - even image classification (by simply conditioning the model on the image and asking it to generate a class for it in text).
32
+
33
+ ## Intended uses & limitations
34
+
35
+ You can use the raw model for image captioning. See the [model hub](https://huggingface.co/models?search=microsoft/git) to look for
36
+ fine-tuned versions on a task that interests you.
37
+
38
+ ### How to use
39
+
40
+ For code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/main/model_doc/git#transformers.GitForCausalLM.forward.example).
41
+
42
+ ## Training data
43
+
44
+ From the paper:
45
+
46
+ > We collect 0.8B image-text pairs for pre-training, which include COCO (Lin et al., 2014), Conceptual Captions
47
+ (CC3M) (Sharma et al., 2018), SBU (Ordonez et al., 2011), Visual Genome (VG) (Krishna et al., 2016),
48
+ Conceptual Captions (CC12M) (Changpinyo et al., 2021), ALT200M (Hu et al., 2021a), and an extra 0.6B
49
+ data following a similar collection procedure in Hu et al. (2021a).
50
+
51
+ => however this is for the model referred to as "GIT" in the paper, which is not open-sourced.
52
+
53
+ This checkpoint is "GIT-base", which is a smaller variant of GIT trained on 10 million image-text pairs.
54
+
55
+ Next, the model was fine-tuned on COCO.
56
+
57
+ See table 11 in the [paper](https://arxiv.org/abs/2205.14100) for more details.
58
+
59
+ ### Preprocessing
60
+
61
+ We refer to the original repo regarding details for preprocessing during training.
62
+
63
+ During validation, one resizes the shorter edge of each image, after which center cropping is performed to a fixed-size resolution. Next, frames are normalized across the RGB channels with the ImageNet mean and standard deviation.
64
+
65
+ ## Evaluation results
66
+
67
+ For evaluation results, we refer readers to the [paper](https://arxiv.org/abs/2205.14100).
models/git-base-coco/config.json ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_commit_hash": null,
3
+ "architectures": [
4
+ "GitForCausalLM"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 101,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 102,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "layer_norm_eps": 1e-12,
16
+ "max_position_embeddings": 1024,
17
+ "model_type": "git",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 6,
20
+ "num_image_with_embedding": null,
21
+ "pad_token_id": 0,
22
+ "position_embedding_type": "absolute",
23
+ "tie_word_embeddings": false,
24
+ "torch_dtype": "float32",
25
+ "transformers_version": null,
26
+ "use_cache": true,
27
+ "vision_config": {
28
+ "_name_or_path": "",
29
+ "add_cross_attention": false,
30
+ "architectures": null,
31
+ "attention_dropout": 0.0,
32
+ "bad_words_ids": null,
33
+ "begin_suppress_tokens": null,
34
+ "bos_token_id": null,
35
+ "chunk_size_feed_forward": 0,
36
+ "cross_attention_hidden_size": null,
37
+ "decoder_start_token_id": null,
38
+ "diversity_penalty": 0.0,
39
+ "do_sample": false,
40
+ "dropout": 0.0,
41
+ "early_stopping": false,
42
+ "encoder_no_repeat_ngram_size": 0,
43
+ "eos_token_id": null,
44
+ "exponential_decay_length_penalty": null,
45
+ "finetuning_task": null,
46
+ "forced_bos_token_id": null,
47
+ "forced_eos_token_id": null,
48
+ "hidden_act": "quick_gelu",
49
+ "hidden_size": 768,
50
+ "id2label": {
51
+ "0": "LABEL_0",
52
+ "1": "LABEL_1"
53
+ },
54
+ "image_size": 224,
55
+ "initializer_factor": 1.0,
56
+ "initializer_range": 0.02,
57
+ "intermediate_size": 3072,
58
+ "is_decoder": false,
59
+ "is_encoder_decoder": false,
60
+ "label2id": {
61
+ "LABEL_0": 0,
62
+ "LABEL_1": 1
63
+ },
64
+ "layer_norm_eps": 1e-05,
65
+ "length_penalty": 1.0,
66
+ "max_length": 20,
67
+ "min_length": 0,
68
+ "model_type": "git_vision_model",
69
+ "no_repeat_ngram_size": 0,
70
+ "num_attention_heads": 12,
71
+ "num_beam_groups": 1,
72
+ "num_beams": 1,
73
+ "num_channels": 3,
74
+ "num_hidden_layers": 12,
75
+ "num_return_sequences": 1,
76
+ "output_attentions": false,
77
+ "output_hidden_states": false,
78
+ "output_scores": false,
79
+ "pad_token_id": null,
80
+ "patch_size": 16,
81
+ "prefix": null,
82
+ "problem_type": null,
83
+ "projection_dim": 512,
84
+ "pruned_heads": {},
85
+ "remove_invalid_values": false,
86
+ "repetition_penalty": 1.0,
87
+ "return_dict": true,
88
+ "return_dict_in_generate": false,
89
+ "sep_token_id": null,
90
+ "suppress_tokens": null,
91
+ "task_specific_params": null,
92
+ "temperature": 1.0,
93
+ "tf_legacy_loss": false,
94
+ "tie_encoder_decoder": false,
95
+ "tie_word_embeddings": true,
96
+ "tokenizer_class": null,
97
+ "top_k": 50,
98
+ "top_p": 1.0,
99
+ "torch_dtype": null,
100
+ "torchscript": false,
101
+ "transformers_version": "4.26.0.dev0",
102
+ "typical_p": 1.0,
103
+ "use_bfloat16": false
104
+ },
105
+ "vocab_size": 30522
106
+ }
models/git-base-coco/generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 101,
4
+ "eos_token_id": 102,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.27.0.dev0"
7
+ }
models/git-base-coco/preprocessor_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 224,
4
+ "width": 224
5
+ },
6
+ "do_center_crop": true,
7
+ "do_convert_rgb": true,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.48145466,
13
+ 0.4578275,
14
+ 0.40821073
15
+ ],
16
+ "image_processor_type": "CLIPImageProcessor",
17
+ "image_std": [
18
+ 0.26862954,
19
+ 0.26130258,
20
+ 0.27577711
21
+ ],
22
+ "processor_class": "GitProcessor",
23
+ "resample": 3,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "shortest_edge": 224
27
+ }
28
+ }
models/git-base-coco/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9debdaecd629157630a7a3e69dd1bdae0461290bec8e66c682296813d9391ff2
3
+ size 706587995
models/git-base-coco/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
models/git-base-coco/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
models/git-base-coco/tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "do_lower_case": true,
4
+ "mask_token": "[MASK]",
5
+ "model_input_names": [
6
+ "input_ids",
7
+ "attention_mask"
8
+ ],
9
+ "model_max_length": 512,
10
+ "name_or_path": "bert-base-uncased",
11
+ "pad_token": "[PAD]",
12
+ "processor_class": "GitProcessor",
13
+ "sep_token": "[SEP]",
14
+ "special_tokens_map_file": null,
15
+ "strip_accents": null,
16
+ "tokenize_chinese_chars": true,
17
+ "tokenizer_class": "BertTokenizer",
18
+ "unk_token": "[UNK]"
19
+ }
models/git-base-coco/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
models/git-base-vatex/.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/git-base-vatex/README.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ tags:
5
+ - vision
6
+ inference: false
7
+ model_name: microsoft/git-base-vatex
8
+ ---
9
+
10
+ # GIT (GenerativeImage2Text), base-sized, fine-tuned on VATEX
11
+
12
+ GIT (short for GenerativeImage2Text) model, base-sized version, fine-tuned on VATEX. It was introduced in the paper [GIT: A Generative Image-to-text Transformer for Vision and Language](https://arxiv.org/abs/2205.14100) by Wang et al. and first released in [this repository](https://github.com/microsoft/GenerativeImage2Text).
13
+
14
+ Disclaimer: The team releasing GIT did not write a model card for this model so this model card has been written by the Hugging Face team.
15
+
16
+ ## Model description
17
+
18
+ GIT is a Transformer decoder conditioned on both CLIP image tokens and text tokens. The model is trained using "teacher forcing" on a lot of (image, text) pairs.
19
+
20
+ The goal for the model is simply to predict the next text token, giving the image tokens and previous text tokens.
21
+
22
+ The model has full access to (i.e. a bidirectional attention mask is used for) the image patch tokens, but only has access to the previous text tokens (i.e. a causal attention mask is used for the text tokens) when predicting the next text token.
23
+
24
+ ![GIT architecture](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/git_architecture.jpg)
25
+
26
+ This allows the model to be used for tasks like:
27
+
28
+ - image and video captioning
29
+ - visual question answering (VQA) on images and videos
30
+ - even image classification (by simply conditioning the model on the image and asking it to generate a class for it in text).
31
+
32
+ ## Intended uses & limitations
33
+
34
+ You can use the raw model for video captioning. See the [model hub](https://huggingface.co/models?search=microsoft/git) to look for
35
+ fine-tuned versions on a task that interests you.
36
+
37
+ ### How to use
38
+
39
+ For code examples, we refer to the [documentation](https://huggingface.co/transformers/main/model_doc/git.html).
40
+
41
+ ## Training data
42
+
43
+ From the paper:
44
+
45
+ > We collect 0.8B image-text pairs for pre-training, which include COCO (Lin et al., 2014), Conceptual Captions
46
+ (CC3M) (Sharma et al., 2018), SBU (Ordonez et al., 2011), Visual Genome (VG) (Krishna et al., 2016),
47
+ Conceptual Captions (CC12M) (Changpinyo et al., 2021), ALT200M (Hu et al., 2021a), and an extra 0.6B
48
+ data following a similar collection procedure in Hu et al. (2021a).
49
+
50
+ => however this is for the model referred to as "GIT" in the paper, which is not open-sourced.
51
+
52
+ This checkpoint is "GIT-base", which is a smaller variant of GIT trained on 10 million image-text pairs.
53
+
54
+ Next, the model was fine-tuned on VATEX.
55
+
56
+ See table 11 in the [paper](https://arxiv.org/abs/2205.14100) for more details.
57
+
58
+ ### Preprocessing
59
+
60
+ We refer to the original repo regarding details for preprocessing during training.
61
+
62
+ During validation, one resizes the shorter edge of each image, after which center cropping is performed to a fixed-size resolution. Next, frames are normalized across the RGB channels with the ImageNet mean and standard deviation.
63
+
64
+ ## Evaluation results
65
+
66
+ For evaluation results, we refer readers to the [paper](https://arxiv.org/abs/2205.14100).
models/git-base-vatex/config.json ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_commit_hash": null,
3
+ "architectures": [
4
+ "GitForCausalLM"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 101,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 102,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "layer_norm_eps": 1e-12,
16
+ "max_position_embeddings": 1024,
17
+ "model_type": "git",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 6,
20
+ "num_image_with_embedding": 6,
21
+ "pad_token_id": 0,
22
+ "position_embedding_type": "absolute",
23
+ "tie_word_embeddings": false,
24
+ "torch_dtype": "float32",
25
+ "transformers_version": null,
26
+ "use_cache": true,
27
+ "vision_config": {
28
+ "_name_or_path": "",
29
+ "add_cross_attention": false,
30
+ "architectures": null,
31
+ "attention_dropout": 0.0,
32
+ "bad_words_ids": null,
33
+ "begin_suppress_tokens": null,
34
+ "bos_token_id": null,
35
+ "chunk_size_feed_forward": 0,
36
+ "cross_attention_hidden_size": null,
37
+ "decoder_start_token_id": null,
38
+ "diversity_penalty": 0.0,
39
+ "do_sample": false,
40
+ "dropout": 0.0,
41
+ "early_stopping": false,
42
+ "encoder_no_repeat_ngram_size": 0,
43
+ "eos_token_id": null,
44
+ "exponential_decay_length_penalty": null,
45
+ "finetuning_task": null,
46
+ "forced_bos_token_id": null,
47
+ "forced_eos_token_id": null,
48
+ "hidden_act": "quick_gelu",
49
+ "hidden_size": 768,
50
+ "id2label": {
51
+ "0": "LABEL_0",
52
+ "1": "LABEL_1"
53
+ },
54
+ "image_size": 224,
55
+ "initializer_factor": 1.0,
56
+ "initializer_range": 0.02,
57
+ "intermediate_size": 3072,
58
+ "is_decoder": false,
59
+ "is_encoder_decoder": false,
60
+ "label2id": {
61
+ "LABEL_0": 0,
62
+ "LABEL_1": 1
63
+ },
64
+ "layer_norm_eps": 1e-05,
65
+ "length_penalty": 1.0,
66
+ "max_length": 20,
67
+ "min_length": 0,
68
+ "model_type": "git_vision_model",
69
+ "no_repeat_ngram_size": 0,
70
+ "num_attention_heads": 12,
71
+ "num_beam_groups": 1,
72
+ "num_beams": 1,
73
+ "num_channels": 3,
74
+ "num_hidden_layers": 12,
75
+ "num_return_sequences": 1,
76
+ "output_attentions": false,
77
+ "output_hidden_states": false,
78
+ "output_scores": false,
79
+ "pad_token_id": null,
80
+ "patch_size": 16,
81
+ "prefix": null,
82
+ "problem_type": null,
83
+ "projection_dim": 512,
84
+ "pruned_heads": {},
85
+ "remove_invalid_values": false,
86
+ "repetition_penalty": 1.0,
87
+ "return_dict": true,
88
+ "return_dict_in_generate": false,
89
+ "sep_token_id": null,
90
+ "suppress_tokens": null,
91
+ "task_specific_params": null,
92
+ "temperature": 1.0,
93
+ "tf_legacy_loss": false,
94
+ "tie_encoder_decoder": false,
95
+ "tie_word_embeddings": true,
96
+ "tokenizer_class": null,
97
+ "top_k": 50,
98
+ "top_p": 1.0,
99
+ "torch_dtype": null,
100
+ "torchscript": false,
101
+ "transformers_version": "4.26.0.dev0",
102
+ "typical_p": 1.0,
103
+ "use_bfloat16": false
104
+ },
105
+ "vocab_size": 30522
106
+ }
models/git-base-vatex/generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 101,
4
+ "eos_token_id": 102,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.27.0.dev0"
7
+ }
models/git-base-vatex/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:04ea5c7d586ada3d9fb626eec35fef084c45d6f8b817469fb520ab9cbcca44ca
3
+ size 706545064
models/git-base-vatex/preprocessor_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 224,
4
+ "width": 224
5
+ },
6
+ "do_center_crop": true,
7
+ "do_normalize": true,
8
+ "do_rescale": true,
9
+ "do_resize": true,
10
+ "image_mean": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "image_processor_type": "VideoMAEImageProcessor",
16
+ "image_std": [
17
+ 0.5,
18
+ 0.5,
19
+ 0.5
20
+ ],
21
+ "processor_class": "GitProcessor",
22
+ "resample": 2,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "shortest_edge": 224
26
+ }
27
+ }
models/git-base-vatex/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86b105d7af9b197e86d20d38afcc41a459133ee63af71b55f89e487934b5abb7
3
+ size 706608271
models/git-base-vatex/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
models/git-base-vatex/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
models/git-base-vatex/tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "do_lower_case": true,
4
+ "mask_token": "[MASK]",
5
+ "model_input_names": [
6
+ "input_ids",
7
+ "attention_mask"
8
+ ],
9
+ "model_max_length": 512,
10
+ "name_or_path": "bert-base-uncased",
11
+ "pad_token": "[PAD]",
12
+ "processor_class": "GitProcessor",
13
+ "sep_token": "[SEP]",
14
+ "special_tokens_map_file": null,
15
+ "strip_accents": null,
16
+ "tokenize_chinese_chars": true,
17
+ "tokenizer_class": "BertTokenizer",
18
+ "unk_token": "[UNK]"
19
+ }
models/git-base-vatex/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
models/git-base-vqav2/.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/git-base-vqav2/README.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ tags:
5
+ - vision
6
+ model_name: microsoft/git-base-vqav2
7
+ inference: false
8
+ pipeline_tag: visual-question-answering
9
+ ---
10
+
11
+ # GIT (GenerativeImage2Text), base-sized, fine-tuned on VQAv2
12
+
13
+ GIT (short for GenerativeImage2Text) model, base-sized version, fine-tuned on VQAv2. It was introduced in the paper [GIT: A Generative Image-to-text Transformer for Vision and Language](https://arxiv.org/abs/2205.14100) by Wang et al. and first released in [this repository](https://github.com/microsoft/GenerativeImage2Text).
14
+
15
+ Disclaimer: The team releasing GIT did not write a model card for this model so this model card has been written by the Hugging Face team.
16
+
17
+ ## Model description
18
+
19
+ GIT is a Transformer decoder conditioned on both CLIP image tokens and text tokens. The model is trained using "teacher forcing" on a lot of (image, text) pairs.
20
+
21
+ The goal for the model is simply to predict the next text token, giving the image tokens and previous text tokens.
22
+
23
+ The model has full access to (i.e. a bidirectional attention mask is used for) the image patch tokens, but only has access to the previous text tokens (i.e. a causal attention mask is used for the text tokens) when predicting the next text token.
24
+
25
+ ![GIT architecture](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/git_architecture.jpg)
26
+
27
+ This allows the model to be used for tasks like:
28
+
29
+ - image and video captioning
30
+ - visual question answering (VQA) on images and videos
31
+ - even image classification (by simply conditioning the model on the image and asking it to generate a class for it in text).
32
+
33
+ ## Intended uses & limitations
34
+
35
+ You can use the raw model for visual question answering (VQA). See the [model hub](https://huggingface.co/models?search=microsoft/git) to look for
36
+ fine-tuned versions on a task that interests you.
37
+
38
+ ### How to use
39
+
40
+ For code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/main/model_doc/git#transformers.GitForCausalLM.forward.example-2).
41
+
42
+ ## Training data
43
+
44
+ From the paper:
45
+
46
+ > We collect 0.8B image-text pairs for pre-training, which include COCO (Lin et al., 2014), Conceptual Captions
47
+ (CC3M) (Sharma et al., 2018), SBU (Ordonez et al., 2011), Visual Genome (VG) (Krishna et al., 2016),
48
+ Conceptual Captions (CC12M) (Changpinyo et al., 2021), ALT200M (Hu et al., 2021a), and an extra 0.6B
49
+ data following a similar collection procedure in Hu et al. (2021a).
50
+
51
+ => however this is for the model referred to as "GIT" in the paper, which is not open-sourced.
52
+
53
+ This checkpoint is "GIT-base", which is a smaller variant of GIT trained on 10 million image-text pairs.
54
+
55
+ Next, the model was fine-tuned on VQAv2.
56
+
57
+ See table 11 in the [paper](https://arxiv.org/abs/2205.14100) for more details.
58
+
59
+ ### Preprocessing
60
+
61
+ We refer to the original repo regarding details for preprocessing during training.
62
+
63
+ During validation, one resizes the shorter edge of each image, after which center cropping is performed to a fixed-size resolution. Next, frames are normalized across the RGB channels with the ImageNet mean and standard deviation.
64
+
65
+ ## Evaluation results
66
+
67
+ For evaluation results, we refer readers to the [paper](https://arxiv.org/abs/2205.14100).
models/git-base-vqav2/config.json ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_commit_hash": null,
3
+ "architectures": [
4
+ "GitForCausalLM"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 101,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 102,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "layer_norm_eps": 1e-12,
16
+ "max_position_embeddings": 1024,
17
+ "model_type": "git",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 6,
20
+ "num_image_with_embedding": null,
21
+ "pad_token_id": 0,
22
+ "position_embedding_type": "absolute",
23
+ "tie_word_embeddings": false,
24
+ "torch_dtype": "float32",
25
+ "transformers_version": null,
26
+ "use_cache": true,
27
+ "vision_config": {
28
+ "_name_or_path": "",
29
+ "add_cross_attention": false,
30
+ "architectures": null,
31
+ "attention_dropout": 0.0,
32
+ "bad_words_ids": null,
33
+ "begin_suppress_tokens": null,
34
+ "bos_token_id": null,
35
+ "chunk_size_feed_forward": 0,
36
+ "cross_attention_hidden_size": null,
37
+ "decoder_start_token_id": null,
38
+ "diversity_penalty": 0.0,
39
+ "do_sample": false,
40
+ "dropout": 0.0,
41
+ "early_stopping": false,
42
+ "encoder_no_repeat_ngram_size": 0,
43
+ "eos_token_id": null,
44
+ "exponential_decay_length_penalty": null,
45
+ "finetuning_task": null,
46
+ "forced_bos_token_id": null,
47
+ "forced_eos_token_id": null,
48
+ "hidden_act": "quick_gelu",
49
+ "hidden_size": 768,
50
+ "id2label": {
51
+ "0": "LABEL_0",
52
+ "1": "LABEL_1"
53
+ },
54
+ "image_size": 480,
55
+ "initializer_factor": 1.0,
56
+ "initializer_range": 0.02,
57
+ "intermediate_size": 3072,
58
+ "is_decoder": false,
59
+ "is_encoder_decoder": false,
60
+ "label2id": {
61
+ "LABEL_0": 0,
62
+ "LABEL_1": 1
63
+ },
64
+ "layer_norm_eps": 1e-05,
65
+ "length_penalty": 1.0,
66
+ "max_length": 20,
67
+ "min_length": 0,
68
+ "model_type": "git_vision_model",
69
+ "no_repeat_ngram_size": 0,
70
+ "num_attention_heads": 12,
71
+ "num_beam_groups": 1,
72
+ "num_beams": 1,
73
+ "num_channels": 3,
74
+ "num_hidden_layers": 12,
75
+ "num_return_sequences": 1,
76
+ "output_attentions": false,
77
+ "output_hidden_states": false,
78
+ "output_scores": false,
79
+ "pad_token_id": null,
80
+ "patch_size": 16,
81
+ "prefix": null,
82
+ "problem_type": null,
83
+ "projection_dim": 512,
84
+ "pruned_heads": {},
85
+ "remove_invalid_values": false,
86
+ "repetition_penalty": 1.0,
87
+ "return_dict": true,
88
+ "return_dict_in_generate": false,
89
+ "sep_token_id": null,
90
+ "suppress_tokens": null,
91
+ "task_specific_params": null,
92
+ "temperature": 1.0,
93
+ "tf_legacy_loss": false,
94
+ "tie_encoder_decoder": false,
95
+ "tie_word_embeddings": true,
96
+ "tokenizer_class": null,
97
+ "top_k": 50,
98
+ "top_p": 1.0,
99
+ "torch_dtype": null,
100
+ "torchscript": false,
101
+ "transformers_version": "4.26.0.dev0",
102
+ "typical_p": 1.0,
103
+ "use_bfloat16": false
104
+ },
105
+ "vocab_size": 30522
106
+ }
models/git-base-vqav2/generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 101,
4
+ "eos_token_id": 102,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.27.0.dev0"
7
+ }
models/git-base-vqav2/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6fe0c0b99e7a8018f3097e536415393f3c7023129511eb7eee6e15b41fe4f50
3
+ size 708694344
models/git-base-vqav2/preprocessor_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 480,
4
+ "width": 480
5
+ },
6
+ "do_center_crop": true,
7
+ "do_convert_rgb": true,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.48145466,
13
+ 0.4578275,
14
+ 0.40821073
15
+ ],
16
+ "image_processor_type": "CLIPImageProcessor",
17
+ "image_std": [
18
+ 0.26862954,
19
+ 0.26130258,
20
+ 0.27577711
21
+ ],
22
+ "processor_class": "GitProcessor",
23
+ "resample": 3,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "shortest_edge": 480
27
+ }
28
+ }
models/git-base-vqav2/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e75e4c723e2ff445797b48db5d19bbe92ede848837abab5f4f43917e3db2bf20
3
+ size 708756315
models/git-base-vqav2/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
models/git-base-vqav2/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
models/git-base-vqav2/tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "do_lower_case": true,
4
+ "mask_token": "[MASK]",
5
+ "model_input_names": [
6
+ "input_ids",
7
+ "attention_mask"
8
+ ],
9
+ "model_max_length": 512,
10
+ "name_or_path": "bert-base-uncased",
11
+ "pad_token": "[PAD]",
12
+ "processor_class": "GitProcessor",
13
+ "sep_token": "[SEP]",
14
+ "special_tokens_map_file": null,
15
+ "strip_accents": null,
16
+ "tokenize_chinese_chars": true,
17
+ "tokenizer_class": "BertTokenizer",
18
+ "unk_token": "[UNK]"
19
+ }
models/git-base-vqav2/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
models/git-base/.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/git-base/README.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ tags:
5
+ - vision
6
+ - image-to-text
7
+ - image-captioning
8
+ model_name: microsoft/git-base
9
+ pipeline_tag: image-to-text
10
+ ---
11
+
12
+ # GIT (GenerativeImage2Text), base-sized
13
+
14
+ GIT (short for GenerativeImage2Text) model, base-sized version. It was introduced in the paper [GIT: A Generative Image-to-text Transformer for Vision and Language](https://arxiv.org/abs/2205.14100) by Wang et al. and first released in [this repository](https://github.com/microsoft/GenerativeImage2Text).
15
+
16
+ Disclaimer: The team releasing GIT did not write a model card for this model so this model card has been written by the Hugging Face team.
17
+
18
+ ## Model description
19
+
20
+ GIT is a Transformer decoder conditioned on both CLIP image tokens and text tokens. The model is trained using "teacher forcing" on a lot of (image, text) pairs.
21
+
22
+ The goal for the model is simply to predict the next text token, giving the image tokens and previous text tokens.
23
+
24
+ The model has full access to (i.e. a bidirectional attention mask is used for) the image patch tokens, but only has access to the previous text tokens (i.e. a causal attention mask is used for the text tokens) when predicting the next text token.
25
+
26
+ ![GIT architecture](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/git_architecture.jpg)
27
+
28
+ This allows the model to be used for tasks like:
29
+
30
+ - image and video captioning
31
+ - visual question answering (VQA) on images and videos
32
+ - even image classification (by simply conditioning the model on the image and asking it to generate a class for it in text).
33
+
34
+ ## Intended uses & limitations
35
+
36
+ You can use the raw model for image captioning. See the [model hub](https://huggingface.co/models?search=microsoft/git) to look for
37
+ fine-tuned versions on a task that interests you.
38
+
39
+ ### How to use
40
+
41
+ For code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/main/model_doc/git#transformers.GitForCausalLM.forward.example).
42
+
43
+ ## Training data
44
+
45
+ From the paper:
46
+
47
+ > We collect 0.8B image-text pairs for pre-training, which include COCO (Lin et al., 2014), Conceptual Captions
48
+ (CC3M) (Sharma et al., 2018), SBU (Ordonez et al., 2011), Visual Genome (VG) (Krishna et al., 2016),
49
+ Conceptual Captions (CC12M) (Changpinyo et al., 2021), ALT200M (Hu et al., 2021a), and an extra 0.6B
50
+ data following a similar collection procedure in Hu et al. (2021a).
51
+
52
+ => however this is for the model referred to as "GIT" in the paper, which is not open-sourced.
53
+
54
+ This checkpoint is "GIT-base", which is a smaller variant of GIT trained on 10 million image-text pairs.
55
+
56
+ See table 11 in the [paper](https://arxiv.org/abs/2205.14100) for more details.
57
+
58
+ ### Preprocessing
59
+
60
+ We refer to the original repo regarding details for preprocessing during training.
61
+
62
+ During validation, one resizes the shorter edge of each image, after which center cropping is performed to a fixed-size resolution. Next, frames are normalized across the RGB channels with the ImageNet mean and standard deviation.
63
+
64
+ ## Evaluation results
65
+
66
+ For evaluation results, we refer readers to the [paper](https://arxiv.org/abs/2205.14100).
models/git-base/config.json ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_commit_hash": null,
3
+ "architectures": [
4
+ "GitForCausalLM"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 101,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 102,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "layer_norm_eps": 1e-12,
16
+ "max_position_embeddings": 1024,
17
+ "model_type": "git",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 6,
20
+ "num_image_with_embedding": null,
21
+ "pad_token_id": 0,
22
+ "position_embedding_type": "absolute",
23
+ "tie_word_embeddings": false,
24
+ "torch_dtype": "float32",
25
+ "transformers_version": null,
26
+ "use_cache": true,
27
+ "vision_config": {
28
+ "_name_or_path": "",
29
+ "add_cross_attention": false,
30
+ "architectures": null,
31
+ "attention_dropout": 0.0,
32
+ "bad_words_ids": null,
33
+ "begin_suppress_tokens": null,
34
+ "bos_token_id": null,
35
+ "chunk_size_feed_forward": 0,
36
+ "cross_attention_hidden_size": null,
37
+ "decoder_start_token_id": null,
38
+ "diversity_penalty": 0.0,
39
+ "do_sample": false,
40
+ "dropout": 0.0,
41
+ "early_stopping": false,
42
+ "encoder_no_repeat_ngram_size": 0,
43
+ "eos_token_id": null,
44
+ "exponential_decay_length_penalty": null,
45
+ "finetuning_task": null,
46
+ "forced_bos_token_id": null,
47
+ "forced_eos_token_id": null,
48
+ "hidden_act": "quick_gelu",
49
+ "hidden_size": 768,
50
+ "id2label": {
51
+ "0": "LABEL_0",
52
+ "1": "LABEL_1"
53
+ },
54
+ "image_size": 224,
55
+ "initializer_factor": 1.0,
56
+ "initializer_range": 0.02,
57
+ "intermediate_size": 3072,
58
+ "is_decoder": false,
59
+ "is_encoder_decoder": false,
60
+ "label2id": {
61
+ "LABEL_0": 0,
62
+ "LABEL_1": 1
63
+ },
64
+ "layer_norm_eps": 1e-05,
65
+ "length_penalty": 1.0,
66
+ "max_length": 20,
67
+ "min_length": 0,
68
+ "model_type": "git_vision_model",
69
+ "no_repeat_ngram_size": 0,
70
+ "num_attention_heads": 12,
71
+ "num_beam_groups": 1,
72
+ "num_beams": 1,
73
+ "num_channels": 3,
74
+ "num_hidden_layers": 12,
75
+ "num_return_sequences": 1,
76
+ "output_attentions": false,
77
+ "output_hidden_states": false,
78
+ "output_scores": false,
79
+ "pad_token_id": null,
80
+ "patch_size": 16,
81
+ "prefix": null,
82
+ "problem_type": null,
83
+ "projection_dim": 512,
84
+ "pruned_heads": {},
85
+ "remove_invalid_values": false,
86
+ "repetition_penalty": 1.0,
87
+ "return_dict": true,
88
+ "return_dict_in_generate": false,
89
+ "sep_token_id": null,
90
+ "suppress_tokens": null,
91
+ "task_specific_params": null,
92
+ "temperature": 1.0,
93
+ "tf_legacy_loss": false,
94
+ "tie_encoder_decoder": false,
95
+ "tie_word_embeddings": true,
96
+ "tokenizer_class": null,
97
+ "top_k": 50,
98
+ "top_p": 1.0,
99
+ "torch_dtype": null,
100
+ "torchscript": false,
101
+ "transformers_version": "4.26.0.dev0",
102
+ "typical_p": 1.0,
103
+ "use_bfloat16": false
104
+ },
105
+ "vocab_size": 30522
106
+ }
models/git-base/generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 101,
4
+ "eos_token_id": 102,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.27.0.dev0"
7
+ }