Instructions to use thealper2/git-vqav2-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thealper2/git-vqav2-medium with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "visual-question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("visual-question-answering", model="thealper2/git-vqav2-medium")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("thealper2/git-vqav2-medium") model = AutoModelForMultimodalLM.from_pretrained("thealper2/git-vqav2-medium", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload fine-tuned GIT-base VQAv2 (git-vqav2-medium)
Browse files- README.md +110 -0
- config.json +63 -0
- eval_results.json +191 -0
- experiment_config.yaml +87 -0
- generation_config.json +7 -0
- model.safetensors +3 -0
- processor_config.json +30 -0
- tokenizer.json +0 -0
- tokenizer_config.json +20 -0
- training_info.json +117 -0
README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model: microsoft/git-base-vqav2
|
| 4 |
+
datasets:
|
| 5 |
+
- HuggingFaceM4/VQAv2
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
pipeline_tag: visual-question-answering
|
| 9 |
+
library_name: transformers
|
| 10 |
+
tags:
|
| 11 |
+
- git
|
| 12 |
+
- vqa
|
| 13 |
+
- visual-question-answering
|
| 14 |
+
- image-text-to-text
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# git-vqav2-medium
|
| 18 |
+
|
| 19 |
+
`microsoft/git-base-vqav2` fine-tuned on VQAv2 (50,000 training questions).
|
| 20 |
+
|
| 21 |
+
## Model
|
| 22 |
+
|
| 23 |
+
| | |
|
| 24 |
+
|---|---|
|
| 25 |
+
| Architecture | `GitForCausalLM` (GIT-base) |
|
| 26 |
+
| Vision encoder | CLIP ViT-B/16, 12 layers, 480×480 input, 901 visual tokens |
|
| 27 |
+
| Text decoder | 6-layer causal Transformer, hidden 768, 12 heads, max 1024 positions |
|
| 28 |
+
| Tokenizer | BERT WordPiece (uncased), vocab 30,522 |
|
| 29 |
+
| Parameters | 177,159,738 (trainable during fine-tuning: 177,159,738, strategy `full`) |
|
| 30 |
+
| Weights | fp32, safetensors |
|
| 31 |
+
|
| 32 |
+
## Input / output format
|
| 33 |
+
|
| 34 |
+
- Image: `CLIPImageProcessor` — resize shortest edge to 480 (bicubic), center crop 480×480, rescale 1/255, normalize with CLIP mean/std.
|
| 35 |
+
- Text prompt: `[CLS] question` (no `[SEP]` between question and answer).
|
| 36 |
+
- Output: the answer tokens generated after the prompt, terminated by `[SEP]` (eos id 102).
|
| 37 |
+
- Training sequence: `[CLS] question answer [SEP]`; loss only on `answer [SEP]` (all other positions `-100`).
|
| 38 |
+
|
| 39 |
+
## Training data
|
| 40 |
+
|
| 41 |
+
| | |
|
| 42 |
+
|---|---|
|
| 43 |
+
| Dataset | `HuggingFaceM4/VQAv2`, parquet conversion `refs/convert/parquet` @ `ac4a1a047466a7019b5357ce94b6b5794fc9f867` |
|
| 44 |
+
| Split | `train` (COCO train2014 images) |
|
| 45 |
+
| Shards / questions | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] / 50,000 |
|
| 46 |
+
| Rows skipped (missing question/answer) | 0 |
|
| 47 |
+
| Target answer | majority vote over the 10 human answers (lower-cased, whitespace/edge punctuation stripped; ties → `multiple_choice_answer`) |
|
| 48 |
+
| Model selection | 1,000 questions from `validation` shards [2, 7], best `vqa_accuracy` |
|
| 49 |
+
|
| 50 |
+
## Training procedure
|
| 51 |
+
|
| 52 |
+
| Hyperparameter | Value |
|
| 53 |
+
|---|---|
|
| 54 |
+
| Epochs | 2 |
|
| 55 |
+
| Optimizer | AdamW (β=(0.9, 0.999), ε=1e-8), no decay on biases/LayerNorm |
|
| 56 |
+
| Learning rate | 2e-06, linear decay, warmup 156 steps |
|
| 57 |
+
| Batch size | 8 × 4 accumulation = 32 |
|
| 58 |
+
| Weight decay | 0.01 |
|
| 59 |
+
| Gradient clipping | 1.0 |
|
| 60 |
+
| Precision | bf16 autocast, fp32 master weights |
|
| 61 |
+
| Vision attention | sdpa |
|
| 62 |
+
| Optimizer steps | 3,126 |
|
| 63 |
+
| Best checkpoint | step 500 (vqa_accuracy = 84.39) |
|
| 64 |
+
| Seed | 42 |
|
| 65 |
+
| Hardware | NVIDIA GeForce RTX 5060 Ti |
|
| 66 |
+
| Software | torch 2.11.0+cu128, transformers 5.17.0, datasets 4.3.0 |
|
| 67 |
+
|
| 68 |
+
## Evaluation
|
| 69 |
+
|
| 70 |
+
VQAv2 consensus accuracy (official `vqaEval.py` normalization; per question `mean over 10 leave-one-out subsets of min(1, matches/3)`) and exact match against the majority answer (not an official metric). Deterministic decoding: max_new_tokens=10, num_beams=1, do_sample=False.
|
| 71 |
+
|
| 72 |
+
Evaluation set: 500 questions sampled with a fixed seed from `validation` shard(s) [0] (subset fingerprint `1daf0de4dae278b4`), disjoint from the model-selection questions. Both models were evaluated on exactly the same questions.
|
| 73 |
+
|
| 74 |
+
| Metric | microsoft/git-base-vqav2 | This model | Δ |
|
| 75 |
+
|---|---|---|---|
|
| 76 |
+
| VQA accuracy | 83.32 | 82.54 | -0.78 |
|
| 77 |
+
| Exact match | 73.40 | 72.00 | -1.40 |
|
| 78 |
+
| VQA accuracy (number) | 79.47 | 77.07 | -2.40 |
|
| 79 |
+
| VQA accuracy (other) | 75.74 | 74.84 | -0.90 |
|
| 80 |
+
| VQA accuracy (yes/no) | 95.14 | 95.19 | +0.05 |
|
| 81 |
+
|
| 82 |
+
## Usage
|
| 83 |
+
|
| 84 |
+
```python
|
| 85 |
+
import torch
|
| 86 |
+
from PIL import Image
|
| 87 |
+
from transformers import AutoProcessor, AutoModelForCausalLM
|
| 88 |
+
|
| 89 |
+
repo = "thealper2/git-vqav2-medium"
|
| 90 |
+
processor = AutoProcessor.from_pretrained(repo)
|
| 91 |
+
model = AutoModelForCausalLM.from_pretrained(repo).eval()
|
| 92 |
+
|
| 93 |
+
image = Image.open("example.jpg").convert("RGB")
|
| 94 |
+
question = "what color is the car?"
|
| 95 |
+
pixel_values = processor(images=image, return_tensors="pt").pixel_values
|
| 96 |
+
input_ids = [processor.tokenizer.cls_token_id] + processor.tokenizer(question, add_special_tokens=False).input_ids
|
| 97 |
+
input_ids = torch.tensor([input_ids])
|
| 98 |
+
|
| 99 |
+
out = model.generate(pixel_values=pixel_values, input_ids=input_ids, max_new_tokens=10)
|
| 100 |
+
print(processor.batch_decode(out[:, input_ids.shape[1]:], skip_special_tokens=True)[0])
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
Batched generation: GIT does not derive text position ids from the attention mask, so padded prompts change the output. Batch only prompts of equal token length.
|
| 104 |
+
|
| 105 |
+
## Limitations
|
| 106 |
+
|
| 107 |
+
- Scores are computed on a subset of the official validation split, not on the test-dev evaluation server, and are not comparable to published test-dev numbers.
|
| 108 |
+
- The base checkpoint scores well above published GIT-base test-dev results on these validation questions, which indicates that VQAv2 validation data was part of its original fine-tuning. Absolute accuracies on validation are therefore optimistic for both models.
|
| 109 |
+
- Answers are lower-case (uncased tokenizer). WordPiece splits punctuation, so decoded answers such as `11 : 10` need detokenization (`11:10`).
|
| 110 |
+
- English only; COCO-domain images.
|
config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"GitForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"bos_token_id": 101,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"dtype": "float32",
|
| 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 |
+
"transformers_version": "5.17.0",
|
| 25 |
+
"use_cache": true,
|
| 26 |
+
"vision_config": {
|
| 27 |
+
"add_cross_attention": false,
|
| 28 |
+
"attention_dropout": 0.0,
|
| 29 |
+
"bos_token_id": null,
|
| 30 |
+
"cross_attention_hidden_size": null,
|
| 31 |
+
"decoder_start_token_id": null,
|
| 32 |
+
"dropout": 0.0,
|
| 33 |
+
"dtype": "float32",
|
| 34 |
+
"eos_token_id": null,
|
| 35 |
+
"finetuning_task": null,
|
| 36 |
+
"hidden_act": "quick_gelu",
|
| 37 |
+
"hidden_size": 768,
|
| 38 |
+
"image_size": 480,
|
| 39 |
+
"initializer_factor": 1.0,
|
| 40 |
+
"initializer_range": 0.02,
|
| 41 |
+
"intermediate_size": 3072,
|
| 42 |
+
"is_decoder": false,
|
| 43 |
+
"layer_norm_eps": 1e-05,
|
| 44 |
+
"model_type": "git_vision_model",
|
| 45 |
+
"num_attention_heads": 12,
|
| 46 |
+
"num_channels": 3,
|
| 47 |
+
"num_hidden_layers": 12,
|
| 48 |
+
"pad_token_id": null,
|
| 49 |
+
"patch_size": 16,
|
| 50 |
+
"prefix": null,
|
| 51 |
+
"projection_dim": 512,
|
| 52 |
+
"pruned_heads": {},
|
| 53 |
+
"sep_token_id": null,
|
| 54 |
+
"task_specific_params": null,
|
| 55 |
+
"tf_legacy_loss": false,
|
| 56 |
+
"tie_encoder_decoder": false,
|
| 57 |
+
"tie_word_embeddings": true,
|
| 58 |
+
"tokenizer_class": null,
|
| 59 |
+
"torchscript": false,
|
| 60 |
+
"use_bfloat16": false
|
| 61 |
+
},
|
| 62 |
+
"vocab_size": 30522
|
| 63 |
+
}
|
eval_results.json
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"finetuned": {
|
| 3 |
+
"vqa_accuracy": 82.54,
|
| 4 |
+
"exact_match": 72.0,
|
| 5 |
+
"vqa_accuracy_by_answer_type": {
|
| 6 |
+
"number": {
|
| 7 |
+
"n": 75,
|
| 8 |
+
"vqa_accuracy": 77.07
|
| 9 |
+
},
|
| 10 |
+
"other": {
|
| 11 |
+
"n": 244,
|
| 12 |
+
"vqa_accuracy": 74.84
|
| 13 |
+
},
|
| 14 |
+
"yes/no": {
|
| 15 |
+
"n": 181,
|
| 16 |
+
"vqa_accuracy": 95.19
|
| 17 |
+
}
|
| 18 |
+
},
|
| 19 |
+
"num_examples": 500,
|
| 20 |
+
"subset_fingerprint": "1daf0de4dae278b4",
|
| 21 |
+
"generation": {
|
| 22 |
+
"max_new_tokens": 10,
|
| 23 |
+
"num_beams": 1,
|
| 24 |
+
"do_sample": false,
|
| 25 |
+
"eos_token_id": 102,
|
| 26 |
+
"pad_token_id": 0
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"comparison": {
|
| 30 |
+
"subset_fingerprint": "1daf0de4dae278b4",
|
| 31 |
+
"num_examples": 500,
|
| 32 |
+
"base_model": "microsoft/git-base-vqav2",
|
| 33 |
+
"finetuned_model": "outputs/git-vqav2-medium/best",
|
| 34 |
+
"metrics": {
|
| 35 |
+
"vqa_accuracy": {
|
| 36 |
+
"base": 83.32,
|
| 37 |
+
"finetuned": 82.54,
|
| 38 |
+
"absolute_improvement": -0.78
|
| 39 |
+
},
|
| 40 |
+
"exact_match": {
|
| 41 |
+
"base": 73.4,
|
| 42 |
+
"finetuned": 72.0,
|
| 43 |
+
"absolute_improvement": -1.4
|
| 44 |
+
},
|
| 45 |
+
"vqa_accuracy_number": {
|
| 46 |
+
"base": 79.47,
|
| 47 |
+
"finetuned": 77.07,
|
| 48 |
+
"absolute_improvement": -2.4
|
| 49 |
+
},
|
| 50 |
+
"vqa_accuracy_other": {
|
| 51 |
+
"base": 75.74,
|
| 52 |
+
"finetuned": 74.84,
|
| 53 |
+
"absolute_improvement": -0.9
|
| 54 |
+
},
|
| 55 |
+
"vqa_accuracy_yes/no": {
|
| 56 |
+
"base": 95.14,
|
| 57 |
+
"finetuned": 95.19,
|
| 58 |
+
"absolute_improvement": 0.05
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
},
|
| 62 |
+
"training_summary": {
|
| 63 |
+
"global_step": 3126,
|
| 64 |
+
"epochs": 2,
|
| 65 |
+
"runtime_sec_this_session": 5464.2,
|
| 66 |
+
"best_metric_name": "vqa_accuracy",
|
| 67 |
+
"best_metric": 84.39,
|
| 68 |
+
"best_step": 500,
|
| 69 |
+
"skipped_images": 0,
|
| 70 |
+
"skipped_question_ids": [],
|
| 71 |
+
"truncated_sequences": 2,
|
| 72 |
+
"total_steps": 3126,
|
| 73 |
+
"warmup_steps": 156,
|
| 74 |
+
"peak_gpu_memory": {
|
| 75 |
+
"gpu": "NVIDIA GeForce RTX 5060 Ti",
|
| 76 |
+
"vram_total_gb": 15.9,
|
| 77 |
+
"vram_free_gb": 12.5,
|
| 78 |
+
"vram_allocated_gb": 2.0,
|
| 79 |
+
"vram_reserved_gb": 2.26,
|
| 80 |
+
"vram_max_allocated_gb": 11.23,
|
| 81 |
+
"vram_max_reserved_gb": 11.77
|
| 82 |
+
}
|
| 83 |
+
},
|
| 84 |
+
"eval_history": [
|
| 85 |
+
{
|
| 86 |
+
"type": "eval",
|
| 87 |
+
"step": 500,
|
| 88 |
+
"epoch": 0.32,
|
| 89 |
+
"val_loss": 0.51991,
|
| 90 |
+
"vqa_accuracy": 84.39,
|
| 91 |
+
"exact_match": 76.0,
|
| 92 |
+
"val_skipped_images": 0,
|
| 93 |
+
"vram_total_gb": 15.9,
|
| 94 |
+
"vram_free_gb": 2.64,
|
| 95 |
+
"vram_allocated_gb": 2.0,
|
| 96 |
+
"vram_reserved_gb": 11.71,
|
| 97 |
+
"vram_max_allocated_gb": 11.23,
|
| 98 |
+
"vram_max_reserved_gb": 11.71
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"type": "eval",
|
| 102 |
+
"step": 1000,
|
| 103 |
+
"epoch": 0.64,
|
| 104 |
+
"val_loss": 0.52613,
|
| 105 |
+
"vqa_accuracy": 83.62,
|
| 106 |
+
"exact_match": 75.5,
|
| 107 |
+
"val_skipped_images": 0,
|
| 108 |
+
"vram_total_gb": 15.9,
|
| 109 |
+
"vram_free_gb": 2.58,
|
| 110 |
+
"vram_allocated_gb": 2.0,
|
| 111 |
+
"vram_reserved_gb": 11.71,
|
| 112 |
+
"vram_max_allocated_gb": 11.23,
|
| 113 |
+
"vram_max_reserved_gb": 11.71
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "eval",
|
| 117 |
+
"step": 1500,
|
| 118 |
+
"epoch": 0.96,
|
| 119 |
+
"val_loss": 0.51468,
|
| 120 |
+
"vqa_accuracy": 83.82,
|
| 121 |
+
"exact_match": 75.4,
|
| 122 |
+
"val_skipped_images": 0,
|
| 123 |
+
"vram_total_gb": 15.9,
|
| 124 |
+
"vram_free_gb": 2.68,
|
| 125 |
+
"vram_allocated_gb": 2.0,
|
| 126 |
+
"vram_reserved_gb": 11.71,
|
| 127 |
+
"vram_max_allocated_gb": 11.23,
|
| 128 |
+
"vram_max_reserved_gb": 11.71
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "eval",
|
| 132 |
+
"step": 2000,
|
| 133 |
+
"epoch": 1.28,
|
| 134 |
+
"val_loss": 0.51831,
|
| 135 |
+
"vqa_accuracy": 84.06,
|
| 136 |
+
"exact_match": 75.9,
|
| 137 |
+
"val_skipped_images": 0,
|
| 138 |
+
"vram_total_gb": 15.9,
|
| 139 |
+
"vram_free_gb": 2.32,
|
| 140 |
+
"vram_allocated_gb": 2.0,
|
| 141 |
+
"vram_reserved_gb": 11.77,
|
| 142 |
+
"vram_max_allocated_gb": 11.23,
|
| 143 |
+
"vram_max_reserved_gb": 11.77
|
| 144 |
+
},
|
| 145 |
+
{
|
| 146 |
+
"type": "eval",
|
| 147 |
+
"step": 2500,
|
| 148 |
+
"epoch": 1.6,
|
| 149 |
+
"val_loss": 0.51739,
|
| 150 |
+
"vqa_accuracy": 83.76,
|
| 151 |
+
"exact_match": 75.1,
|
| 152 |
+
"val_skipped_images": 0,
|
| 153 |
+
"vram_total_gb": 15.9,
|
| 154 |
+
"vram_free_gb": 1.79,
|
| 155 |
+
"vram_allocated_gb": 2.0,
|
| 156 |
+
"vram_reserved_gb": 11.71,
|
| 157 |
+
"vram_max_allocated_gb": 11.23,
|
| 158 |
+
"vram_max_reserved_gb": 11.77
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"type": "eval",
|
| 162 |
+
"step": 3000,
|
| 163 |
+
"epoch": 1.92,
|
| 164 |
+
"val_loss": 0.51595,
|
| 165 |
+
"vqa_accuracy": 83.62,
|
| 166 |
+
"exact_match": 74.7,
|
| 167 |
+
"val_skipped_images": 0,
|
| 168 |
+
"vram_total_gb": 15.9,
|
| 169 |
+
"vram_free_gb": 2.42,
|
| 170 |
+
"vram_allocated_gb": 2.0,
|
| 171 |
+
"vram_reserved_gb": 11.77,
|
| 172 |
+
"vram_max_allocated_gb": 11.23,
|
| 173 |
+
"vram_max_reserved_gb": 11.77
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"type": "eval",
|
| 177 |
+
"step": 3126,
|
| 178 |
+
"epoch": 2.0,
|
| 179 |
+
"val_loss": 0.51609,
|
| 180 |
+
"vqa_accuracy": 83.69,
|
| 181 |
+
"exact_match": 74.7,
|
| 182 |
+
"val_skipped_images": 0,
|
| 183 |
+
"vram_total_gb": 15.9,
|
| 184 |
+
"vram_free_gb": 2.52,
|
| 185 |
+
"vram_allocated_gb": 2.0,
|
| 186 |
+
"vram_reserved_gb": 11.71,
|
| 187 |
+
"vram_max_allocated_gb": 11.23,
|
| 188 |
+
"vram_max_reserved_gb": 11.77
|
| 189 |
+
}
|
| 190 |
+
]
|
| 191 |
+
}
|
experiment_config.yaml
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
experiment_name: medium
|
| 2 |
+
seed: 42
|
| 3 |
+
deterministic: false
|
| 4 |
+
precision: auto
|
| 5 |
+
model:
|
| 6 |
+
name: microsoft/git-base-vqav2
|
| 7 |
+
finetune_strategy: full
|
| 8 |
+
gradient_checkpointing: false
|
| 9 |
+
vision_attn_implementation: sdpa
|
| 10 |
+
image_processor_backend: null
|
| 11 |
+
dataset:
|
| 12 |
+
name: HuggingFaceM4/VQAv2
|
| 13 |
+
revision: ac4a1a047466a7019b5357ce94b6b5794fc9f867
|
| 14 |
+
subset_seed: 42
|
| 15 |
+
max_question_tokens: 32
|
| 16 |
+
max_answer_tokens: 16
|
| 17 |
+
train:
|
| 18 |
+
split: train
|
| 19 |
+
shards:
|
| 20 |
+
- 0
|
| 21 |
+
- 1
|
| 22 |
+
- 2
|
| 23 |
+
- 3
|
| 24 |
+
- 4
|
| 25 |
+
- 5
|
| 26 |
+
- 6
|
| 27 |
+
- 7
|
| 28 |
+
- 8
|
| 29 |
+
- 9
|
| 30 |
+
- 10
|
| 31 |
+
- 11
|
| 32 |
+
- 12
|
| 33 |
+
- 13
|
| 34 |
+
- 14
|
| 35 |
+
- 15
|
| 36 |
+
- 16
|
| 37 |
+
- 17
|
| 38 |
+
- 18
|
| 39 |
+
- 19
|
| 40 |
+
samples: 50000
|
| 41 |
+
val:
|
| 42 |
+
split: validation
|
| 43 |
+
shards:
|
| 44 |
+
- 2
|
| 45 |
+
- 7
|
| 46 |
+
samples: 1000
|
| 47 |
+
test:
|
| 48 |
+
split: validation
|
| 49 |
+
shards:
|
| 50 |
+
- 0
|
| 51 |
+
samples: 500
|
| 52 |
+
training:
|
| 53 |
+
epochs: 2
|
| 54 |
+
learning_rate: 2.0e-06
|
| 55 |
+
batch_size: 8
|
| 56 |
+
gradient_accumulation_steps: 4
|
| 57 |
+
weight_decay: 0.01
|
| 58 |
+
warmup_ratio: 0.05
|
| 59 |
+
lr_scheduler: linear
|
| 60 |
+
max_grad_norm: 1.0
|
| 61 |
+
num_workers: 6
|
| 62 |
+
logging_steps: 10
|
| 63 |
+
save_steps: 500
|
| 64 |
+
save_total_limit: 3
|
| 65 |
+
memory_test: true
|
| 66 |
+
gpu_memory_reserve_gb: 0.5
|
| 67 |
+
tensorboard: true
|
| 68 |
+
evaluation:
|
| 69 |
+
batch_size: 32
|
| 70 |
+
eval_steps: 500
|
| 71 |
+
metric_for_best: vqa_accuracy
|
| 72 |
+
generate_during_training: true
|
| 73 |
+
output_dir: outputs/eval
|
| 74 |
+
generation:
|
| 75 |
+
max_new_tokens: 10
|
| 76 |
+
num_beams: 1
|
| 77 |
+
do_sample: false
|
| 78 |
+
temperature: 1.0
|
| 79 |
+
top_p: 1.0
|
| 80 |
+
overfit:
|
| 81 |
+
samples: 20
|
| 82 |
+
batch_size: 4
|
| 83 |
+
steps: 100
|
| 84 |
+
learning_rate: 0.0001
|
| 85 |
+
output_dir: outputs/overfit
|
| 86 |
+
output:
|
| 87 |
+
directory: outputs/git-vqav2-medium
|
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": "5.17.0"
|
| 7 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d332dae2575605d7f63aa4c60a4cb275edd3ca211a3ac07caeb9286fe5031ba
|
| 3 |
+
size 708678728
|
processor_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"crop_size": {
|
| 4 |
+
"height": 480,
|
| 5 |
+
"width": 480
|
| 6 |
+
},
|
| 7 |
+
"do_center_crop": true,
|
| 8 |
+
"do_convert_rgb": true,
|
| 9 |
+
"do_normalize": true,
|
| 10 |
+
"do_rescale": true,
|
| 11 |
+
"do_resize": true,
|
| 12 |
+
"image_mean": [
|
| 13 |
+
0.48145466,
|
| 14 |
+
0.4578275,
|
| 15 |
+
0.40821073
|
| 16 |
+
],
|
| 17 |
+
"image_processor_type": "CLIPImageProcessor",
|
| 18 |
+
"image_std": [
|
| 19 |
+
0.26862954,
|
| 20 |
+
0.26130258,
|
| 21 |
+
0.27577711
|
| 22 |
+
],
|
| 23 |
+
"resample": 3,
|
| 24 |
+
"rescale_factor": 0.00392156862745098,
|
| 25 |
+
"size": {
|
| 26 |
+
"shortest_edge": 480
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"processor_class": "GitProcessor"
|
| 30 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_lower_case": true,
|
| 5 |
+
"is_local": false,
|
| 6 |
+
"local_files_only": false,
|
| 7 |
+
"mask_token": "[MASK]",
|
| 8 |
+
"model_input_names": [
|
| 9 |
+
"input_ids",
|
| 10 |
+
"attention_mask"
|
| 11 |
+
],
|
| 12 |
+
"model_max_length": 512,
|
| 13 |
+
"pad_token": "[PAD]",
|
| 14 |
+
"processor_class": "GitProcessor",
|
| 15 |
+
"sep_token": "[SEP]",
|
| 16 |
+
"strip_accents": null,
|
| 17 |
+
"tokenize_chinese_chars": true,
|
| 18 |
+
"tokenizer_class": "BertTokenizer",
|
| 19 |
+
"unk_token": "[UNK]"
|
| 20 |
+
}
|
training_info.json
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best": {
|
| 3 |
+
"type": "eval",
|
| 4 |
+
"step": 500,
|
| 5 |
+
"epoch": 0.32,
|
| 6 |
+
"val_loss": 0.51991,
|
| 7 |
+
"vqa_accuracy": 84.39,
|
| 8 |
+
"exact_match": 76.0,
|
| 9 |
+
"val_skipped_images": 0,
|
| 10 |
+
"vram_total_gb": 15.9,
|
| 11 |
+
"vram_free_gb": 2.64,
|
| 12 |
+
"vram_allocated_gb": 2.0,
|
| 13 |
+
"vram_reserved_gb": 11.71,
|
| 14 |
+
"vram_max_allocated_gb": 11.23,
|
| 15 |
+
"vram_max_reserved_gb": 11.71
|
| 16 |
+
},
|
| 17 |
+
"model_name": "microsoft/git-base-vqav2",
|
| 18 |
+
"dataset_name": "HuggingFaceM4/VQAv2",
|
| 19 |
+
"dataset_revision": "ac4a1a047466a7019b5357ce94b6b5794fc9f867",
|
| 20 |
+
"train_data": {
|
| 21 |
+
"rows_total": 80000,
|
| 22 |
+
"rows_valid": 80000,
|
| 23 |
+
"rows_skipped": 0,
|
| 24 |
+
"skipped_by_reason": {
|
| 25 |
+
"missing_question": 0,
|
| 26 |
+
"missing_answers": 0
|
| 27 |
+
},
|
| 28 |
+
"skipped_example_question_ids": {},
|
| 29 |
+
"split": "train",
|
| 30 |
+
"shards": [
|
| 31 |
+
0,
|
| 32 |
+
1,
|
| 33 |
+
2,
|
| 34 |
+
3,
|
| 35 |
+
4,
|
| 36 |
+
5,
|
| 37 |
+
6,
|
| 38 |
+
7,
|
| 39 |
+
8,
|
| 40 |
+
9,
|
| 41 |
+
10,
|
| 42 |
+
11,
|
| 43 |
+
12,
|
| 44 |
+
13,
|
| 45 |
+
14,
|
| 46 |
+
15,
|
| 47 |
+
16,
|
| 48 |
+
17,
|
| 49 |
+
18,
|
| 50 |
+
19
|
| 51 |
+
],
|
| 52 |
+
"requested_samples": 50000,
|
| 53 |
+
"selected_samples": 50000,
|
| 54 |
+
"subset_seed": 42,
|
| 55 |
+
"revision": "ac4a1a047466a7019b5357ce94b6b5794fc9f867"
|
| 56 |
+
},
|
| 57 |
+
"val_data": {
|
| 58 |
+
"rows_total": 8000,
|
| 59 |
+
"rows_valid": 8000,
|
| 60 |
+
"rows_skipped": 0,
|
| 61 |
+
"skipped_by_reason": {
|
| 62 |
+
"missing_question": 0,
|
| 63 |
+
"missing_answers": 0
|
| 64 |
+
},
|
| 65 |
+
"skipped_example_question_ids": {},
|
| 66 |
+
"split": "validation",
|
| 67 |
+
"shards": [
|
| 68 |
+
2,
|
| 69 |
+
7
|
| 70 |
+
],
|
| 71 |
+
"requested_samples": 1000,
|
| 72 |
+
"selected_samples": 1000,
|
| 73 |
+
"subset_seed": 43,
|
| 74 |
+
"revision": "ac4a1a047466a7019b5357ce94b6b5794fc9f867"
|
| 75 |
+
},
|
| 76 |
+
"parameters": {
|
| 77 |
+
"total": 177159738,
|
| 78 |
+
"trainable": 177159738,
|
| 79 |
+
"frozen": 0,
|
| 80 |
+
"trainable_pct": 100.0
|
| 81 |
+
},
|
| 82 |
+
"precision": "bf16",
|
| 83 |
+
"seed": 42,
|
| 84 |
+
"environment": {
|
| 85 |
+
"python": "3.12.3",
|
| 86 |
+
"platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
|
| 87 |
+
"torch": "2.11.0+cu128",
|
| 88 |
+
"torch_cuda": "12.8",
|
| 89 |
+
"cudnn": 91900,
|
| 90 |
+
"transformers": "5.17.0",
|
| 91 |
+
"datasets": "4.3.0",
|
| 92 |
+
"cuda_available": true,
|
| 93 |
+
"hf_home": "/mnt/d/huggingface",
|
| 94 |
+
"gpu": "NVIDIA GeForce RTX 5060 Ti",
|
| 95 |
+
"gpu_total_gb": 15.9,
|
| 96 |
+
"compute_capability": "12.0",
|
| 97 |
+
"bf16_supported": true
|
| 98 |
+
},
|
| 99 |
+
"hyperparameters": {
|
| 100 |
+
"epochs": 2,
|
| 101 |
+
"learning_rate": 2e-06,
|
| 102 |
+
"batch_size": 8,
|
| 103 |
+
"gradient_accumulation_steps": 4,
|
| 104 |
+
"weight_decay": 0.01,
|
| 105 |
+
"warmup_ratio": 0.05,
|
| 106 |
+
"lr_scheduler": "linear",
|
| 107 |
+
"max_grad_norm": 1.0,
|
| 108 |
+
"num_workers": 6,
|
| 109 |
+
"logging_steps": 10,
|
| 110 |
+
"save_steps": 500,
|
| 111 |
+
"save_total_limit": 3,
|
| 112 |
+
"memory_test": true,
|
| 113 |
+
"gpu_memory_reserve_gb": 0.5,
|
| 114 |
+
"tensorboard": true
|
| 115 |
+
},
|
| 116 |
+
"resumed_from": null
|
| 117 |
+
}
|