ViT-GPT2-FlowerCaptioner-ONNX
Browse files- ViT-GPT2-FlowerCaptioner-ONNX/.gitattributes +35 -0
- ViT-GPT2-FlowerCaptioner-ONNX/README.md +115 -0
- ViT-GPT2-FlowerCaptioner-ONNX/config.json +185 -0
- ViT-GPT2-FlowerCaptioner-ONNX/generation_config.json +7 -0
- ViT-GPT2-FlowerCaptioner-ONNX/merges.txt +0 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model_merged.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model_merged_quantized.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model_quantized.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_with_past_model.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_with_past_model_quantized.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/encoder_model.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/onnx/encoder_model_quantized.onnx +3 -0
- ViT-GPT2-FlowerCaptioner-ONNX/preprocessor_config.json +23 -0
- ViT-GPT2-FlowerCaptioner-ONNX/quantize_config.json +119 -0
- ViT-GPT2-FlowerCaptioner-ONNX/source.txt +1 -0
- ViT-GPT2-FlowerCaptioner-ONNX/special_tokens_map.json +6 -0
- ViT-GPT2-FlowerCaptioner-ONNX/tokenizer.json +0 -0
- ViT-GPT2-FlowerCaptioner-ONNX/tokenizer_config.json +17 -0
- ViT-GPT2-FlowerCaptioner-ONNX/vocab.json +0 -0
ViT-GPT2-FlowerCaptioner-ONNX/.gitattributes
ADDED
|
@@ -0,0 +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
|
ViT-GPT2-FlowerCaptioner-ONNX/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- image-to-text
|
| 6 |
+
- image-captioning
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
base_model: nlpconnect/vit-gpt2-image-captioning
|
| 9 |
+
widget:
|
| 10 |
+
- src: >-
|
| 11 |
+
https://huggingface.co/datasets/cristianglezm/FlowerEvolver-Dataset/resolve/main/flowers/001.png
|
| 12 |
+
example_title: Flower 1
|
| 13 |
+
- src: >-
|
| 14 |
+
https://huggingface.co/datasets/cristianglezm/FlowerEvolver-Dataset/resolve/main/flowers/002.png
|
| 15 |
+
example_title: Flower 2
|
| 16 |
+
- src: >-
|
| 17 |
+
https://huggingface.co/datasets/cristianglezm/FlowerEvolver-Dataset/resolve/main/flowers/003.png
|
| 18 |
+
example_title: Flower 3
|
| 19 |
+
datasets:
|
| 20 |
+
- cristianglezm/FlowerEvolver-Dataset
|
| 21 |
+
metrics:
|
| 22 |
+
- rouge
|
| 23 |
+
pipeline_tag: image-to-text
|
| 24 |
+
library_name: transformers.js
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# ViT-GPT2-FlowerCaptioner
|
| 28 |
+
|
| 29 |
+
This model is a fine-tuned version of [nlpconnect/vit-gpt2-image-captioning](https://huggingface.co/nlpconnect/vit-gpt2-image-captioning) on the [FlowerEvolver-dataset](https://huggingface.co/datasets/cristianglezm/FlowerEvolver-Dataset) dataset.
|
| 30 |
+
It achieves the following results on the evaluation set:
|
| 31 |
+
- Loss: 0.4930
|
| 32 |
+
- Rouge1: 68.3498
|
| 33 |
+
- Rouge2: 46.7534
|
| 34 |
+
- Rougel: 62.3763
|
| 35 |
+
- Rougelsum: 65.9575
|
| 36 |
+
- Gen Len: 49.82
|
| 37 |
+
|
| 38 |
+
## sample running code
|
| 39 |
+
|
| 40 |
+
with python
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from transformers import pipeline
|
| 44 |
+
|
| 45 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 46 |
+
FlowerCaptioner = pipeline("image-to-text", model="cristianglezm/ViT-GPT2-FlowerCaptioner", device=device)
|
| 47 |
+
FlowerCaptioner(["flower1.png"])
|
| 48 |
+
# A flower with 12 petals in a smooth gradient of green and blue.
|
| 49 |
+
# The center is green with black accents. The stem is long and green.
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
with javascript
|
| 53 |
+
|
| 54 |
+
```javascript
|
| 55 |
+
import { pipeline } from '@xenova/transformers';
|
| 56 |
+
|
| 57 |
+
// Allocate a pipeline for image-to-text
|
| 58 |
+
let pipe = await pipeline('image-to-text', 'cristianglezm/ViT-GPT2-FlowerCaptioner-ONNX');
|
| 59 |
+
|
| 60 |
+
let out = await pipe('flower image url');
|
| 61 |
+
// A flower with 12 petals in a smooth gradient of green and blue.
|
| 62 |
+
// The center is green with black accents. The stem is long and green.
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Training procedure
|
| 66 |
+
|
| 67 |
+
### Training hyperparameters
|
| 68 |
+
|
| 69 |
+
The following hyperparameters were used during training:
|
| 70 |
+
- learning_rate: 5e-05
|
| 71 |
+
- train_batch_size: 4
|
| 72 |
+
- eval_batch_size: 4
|
| 73 |
+
- seed: 42
|
| 74 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 75 |
+
- lr_scheduler_type: linear
|
| 76 |
+
- lr_scheduler_warmup_steps: 500
|
| 77 |
+
- num_epochs: 25
|
| 78 |
+
|
| 79 |
+
### Training results
|
| 80 |
+
|
| 81 |
+
| Training Loss | Epoch | Step | Validation Loss | Rouge1 | Rouge2 | Rougel | Rougelsum | Gen Len |
|
| 82 |
+
|:-------------:|:-----:|:----:|:---------------:|:-------:|:-------:|:-------:|:---------:|:-------:|
|
| 83 |
+
| 0.6986 | 1.0 | 100 | 0.5339 | 64.9813 | 42.4686 | 58.2586 | 63.3933 | 47.25 |
|
| 84 |
+
| 0.3408 | 2.0 | 200 | 0.3263 | 67.5461 | 46.5219 | 62.7962 | 65.6509 | 47.39 |
|
| 85 |
+
| 0.2797 | 3.0 | 300 | 0.2829 | 65.0704 | 42.0682 | 58.4268 | 63.2368 | 56.8 |
|
| 86 |
+
| 0.2584 | 4.0 | 400 | 0.2588 | 65.5074 | 45.227 | 60.2469 | 63.4253 | 52.25 |
|
| 87 |
+
| 0.2589 | 5.0 | 500 | 0.2607 | 66.7346 | 45.8264 | 61.7373 | 64.8857 | 50.64 |
|
| 88 |
+
| 0.2179 | 6.0 | 600 | 0.2697 | 63.8334 | 42.997 | 58.1585 | 61.7704 | 52.43 |
|
| 89 |
+
| 0.1662 | 7.0 | 700 | 0.2631 | 68.6188 | 48.3329 | 63.9474 | 66.6006 | 46.94 |
|
| 90 |
+
| 0.161 | 8.0 | 800 | 0.2749 | 69.0046 | 48.1421 | 63.7844 | 66.8317 | 49.74 |
|
| 91 |
+
| 0.1207 | 9.0 | 900 | 0.3117 | 70.0357 | 48.9002 | 64.416 | 67.7582 | 48.66 |
|
| 92 |
+
| 0.0909 | 10.0 | 1000 | 0.3408 | 65.9578 | 45.2324 | 60.2838 | 63.7493 | 46.92 |
|
| 93 |
+
| 0.0749 | 11.0 | 1100 | 0.3516 | 67.4244 | 46.1985 | 61.6408 | 65.5371 | 46.61 |
|
| 94 |
+
| 0.0665 | 12.0 | 1200 | 0.3730 | 68.6911 | 47.7089 | 63.0381 | 66.6956 | 47.89 |
|
| 95 |
+
| 0.0522 | 13.0 | 1300 | 0.3891 | 67.2365 | 45.4165 | 61.4063 | 64.857 | 48.91 |
|
| 96 |
+
| 0.0355 | 14.0 | 1400 | 0.4128 | 69.1494 | 47.9278 | 63.3334 | 66.5969 | 50.55 |
|
| 97 |
+
| 0.0309 | 15.0 | 1500 | 0.4221 | 66.2447 | 44.937 | 60.1403 | 63.8541 | 50.71 |
|
| 98 |
+
| 0.0265 | 16.0 | 1600 | 0.4343 | 67.8178 | 46.7084 | 61.8173 | 65.4375 | 50.85 |
|
| 99 |
+
| 0.0158 | 17.0 | 1700 | 0.4577 | 67.9846 | 45.9562 | 61.6353 | 65.7207 | 50.81 |
|
| 100 |
+
| 0.0166 | 18.0 | 1800 | 0.4731 | 69.0971 | 47.7001 | 62.856 | 66.7796 | 50.01 |
|
| 101 |
+
| 0.0121 | 19.0 | 1900 | 0.4657 | 68.1397 | 46.4258 | 62.2696 | 65.9332 | 49.15 |
|
| 102 |
+
| 0.0095 | 20.0 | 2000 | 0.4793 | 68.6497 | 47.9446 | 63.0466 | 66.5409 | 50.96 |
|
| 103 |
+
| 0.0086 | 21.0 | 2100 | 0.4780 | 68.4363 | 46.7296 | 62.359 | 66.2626 | 50.02 |
|
| 104 |
+
| 0.0068 | 22.0 | 2200 | 0.4863 | 67.5415 | 46.0821 | 61.57 | 65.4613 | 49.5 |
|
| 105 |
+
| 0.0061 | 23.0 | 2300 | 0.4892 | 68.1283 | 46.5802 | 62.0832 | 66.0203 | 50.21 |
|
| 106 |
+
| 0.006 | 24.0 | 2400 | 0.4912 | 68.1723 | 46.3239 | 62.2007 | 65.6725 | 49.89 |
|
| 107 |
+
| 0.0057 | 25.0 | 2500 | 0.4930 | 68.3498 | 46.7534 | 62.3763 | 65.9575 | 49.82 |
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
### Framework versions
|
| 111 |
+
|
| 112 |
+
- Transformers 4.43.4
|
| 113 |
+
- Pytorch 2.4.1+cu124
|
| 114 |
+
- Datasets 2.20.0
|
| 115 |
+
- Tokenizers 0.19.1
|
ViT-GPT2-FlowerCaptioner-ONNX/config.json
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "./models/FlowerCaptioner",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"VisionEncoderDecoderModel"
|
| 5 |
+
],
|
| 6 |
+
"bos_token_id": 50256,
|
| 7 |
+
"decoder": {
|
| 8 |
+
"_name_or_path": "",
|
| 9 |
+
"activation_function": "gelu_new",
|
| 10 |
+
"add_cross_attention": true,
|
| 11 |
+
"architectures": [
|
| 12 |
+
"GPT2LMHeadModel"
|
| 13 |
+
],
|
| 14 |
+
"attn_pdrop": 0.1,
|
| 15 |
+
"bad_words_ids": null,
|
| 16 |
+
"begin_suppress_tokens": null,
|
| 17 |
+
"bos_token_id": 50256,
|
| 18 |
+
"chunk_size_feed_forward": 0,
|
| 19 |
+
"cross_attention_hidden_size": null,
|
| 20 |
+
"decoder_start_token_id": 50256,
|
| 21 |
+
"diversity_penalty": 0.0,
|
| 22 |
+
"do_sample": false,
|
| 23 |
+
"early_stopping": false,
|
| 24 |
+
"embd_pdrop": 0.1,
|
| 25 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 26 |
+
"eos_token_id": 50256,
|
| 27 |
+
"exponential_decay_length_penalty": null,
|
| 28 |
+
"finetuning_task": null,
|
| 29 |
+
"forced_bos_token_id": null,
|
| 30 |
+
"forced_eos_token_id": null,
|
| 31 |
+
"id2label": {
|
| 32 |
+
"0": "LABEL_0",
|
| 33 |
+
"1": "LABEL_1"
|
| 34 |
+
},
|
| 35 |
+
"initializer_range": 0.02,
|
| 36 |
+
"is_decoder": true,
|
| 37 |
+
"is_encoder_decoder": false,
|
| 38 |
+
"label2id": {
|
| 39 |
+
"LABEL_0": 0,
|
| 40 |
+
"LABEL_1": 1
|
| 41 |
+
},
|
| 42 |
+
"layer_norm_epsilon": 1e-05,
|
| 43 |
+
"length_penalty": 1.0,
|
| 44 |
+
"max_length": 20,
|
| 45 |
+
"min_length": 0,
|
| 46 |
+
"model_type": "gpt2",
|
| 47 |
+
"n_ctx": 1024,
|
| 48 |
+
"n_embd": 768,
|
| 49 |
+
"n_head": 12,
|
| 50 |
+
"n_inner": null,
|
| 51 |
+
"n_layer": 12,
|
| 52 |
+
"n_positions": 1024,
|
| 53 |
+
"no_repeat_ngram_size": 0,
|
| 54 |
+
"num_beam_groups": 1,
|
| 55 |
+
"num_beams": 1,
|
| 56 |
+
"num_return_sequences": 1,
|
| 57 |
+
"output_attentions": false,
|
| 58 |
+
"output_hidden_states": false,
|
| 59 |
+
"output_scores": false,
|
| 60 |
+
"pad_token_id": 50256,
|
| 61 |
+
"prefix": null,
|
| 62 |
+
"problem_type": null,
|
| 63 |
+
"pruned_heads": {},
|
| 64 |
+
"remove_invalid_values": false,
|
| 65 |
+
"reorder_and_upcast_attn": false,
|
| 66 |
+
"repetition_penalty": 1.0,
|
| 67 |
+
"resid_pdrop": 0.1,
|
| 68 |
+
"return_dict": true,
|
| 69 |
+
"return_dict_in_generate": false,
|
| 70 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 71 |
+
"scale_attn_weights": true,
|
| 72 |
+
"sep_token_id": null,
|
| 73 |
+
"summary_activation": null,
|
| 74 |
+
"summary_first_dropout": 0.1,
|
| 75 |
+
"summary_proj_to_labels": true,
|
| 76 |
+
"summary_type": "cls_index",
|
| 77 |
+
"summary_use_proj": true,
|
| 78 |
+
"suppress_tokens": null,
|
| 79 |
+
"task_specific_params": {
|
| 80 |
+
"text-generation": {
|
| 81 |
+
"do_sample": true,
|
| 82 |
+
"max_length": 50
|
| 83 |
+
}
|
| 84 |
+
},
|
| 85 |
+
"temperature": 1.0,
|
| 86 |
+
"tf_legacy_loss": false,
|
| 87 |
+
"tie_encoder_decoder": false,
|
| 88 |
+
"tie_word_embeddings": true,
|
| 89 |
+
"tokenizer_class": null,
|
| 90 |
+
"top_k": 50,
|
| 91 |
+
"top_p": 1.0,
|
| 92 |
+
"torch_dtype": null,
|
| 93 |
+
"torchscript": false,
|
| 94 |
+
"typical_p": 1.0,
|
| 95 |
+
"use_bfloat16": false,
|
| 96 |
+
"use_cache": true,
|
| 97 |
+
"vocab_size": 50257
|
| 98 |
+
},
|
| 99 |
+
"decoder_start_token_id": 50256,
|
| 100 |
+
"encoder": {
|
| 101 |
+
"_name_or_path": "",
|
| 102 |
+
"add_cross_attention": false,
|
| 103 |
+
"architectures": [
|
| 104 |
+
"ViTModel"
|
| 105 |
+
],
|
| 106 |
+
"attention_probs_dropout_prob": 0.0,
|
| 107 |
+
"bad_words_ids": null,
|
| 108 |
+
"begin_suppress_tokens": null,
|
| 109 |
+
"bos_token_id": null,
|
| 110 |
+
"chunk_size_feed_forward": 0,
|
| 111 |
+
"cross_attention_hidden_size": null,
|
| 112 |
+
"decoder_start_token_id": null,
|
| 113 |
+
"diversity_penalty": 0.0,
|
| 114 |
+
"do_sample": false,
|
| 115 |
+
"early_stopping": false,
|
| 116 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 117 |
+
"encoder_stride": 16,
|
| 118 |
+
"eos_token_id": null,
|
| 119 |
+
"exponential_decay_length_penalty": null,
|
| 120 |
+
"finetuning_task": null,
|
| 121 |
+
"forced_bos_token_id": null,
|
| 122 |
+
"forced_eos_token_id": null,
|
| 123 |
+
"hidden_act": "gelu",
|
| 124 |
+
"hidden_dropout_prob": 0.0,
|
| 125 |
+
"hidden_size": 768,
|
| 126 |
+
"id2label": {
|
| 127 |
+
"0": "LABEL_0",
|
| 128 |
+
"1": "LABEL_1"
|
| 129 |
+
},
|
| 130 |
+
"image_size": 224,
|
| 131 |
+
"initializer_range": 0.02,
|
| 132 |
+
"intermediate_size": 3072,
|
| 133 |
+
"is_decoder": false,
|
| 134 |
+
"is_encoder_decoder": false,
|
| 135 |
+
"label2id": {
|
| 136 |
+
"LABEL_0": 0,
|
| 137 |
+
"LABEL_1": 1
|
| 138 |
+
},
|
| 139 |
+
"layer_norm_eps": 1e-12,
|
| 140 |
+
"length_penalty": 1.0,
|
| 141 |
+
"max_length": 20,
|
| 142 |
+
"min_length": 0,
|
| 143 |
+
"model_type": "vit",
|
| 144 |
+
"no_repeat_ngram_size": 0,
|
| 145 |
+
"num_attention_heads": 12,
|
| 146 |
+
"num_beam_groups": 1,
|
| 147 |
+
"num_beams": 1,
|
| 148 |
+
"num_channels": 3,
|
| 149 |
+
"num_hidden_layers": 12,
|
| 150 |
+
"num_return_sequences": 1,
|
| 151 |
+
"output_attentions": false,
|
| 152 |
+
"output_hidden_states": false,
|
| 153 |
+
"output_scores": false,
|
| 154 |
+
"pad_token_id": null,
|
| 155 |
+
"patch_size": 16,
|
| 156 |
+
"prefix": null,
|
| 157 |
+
"problem_type": null,
|
| 158 |
+
"pruned_heads": {},
|
| 159 |
+
"qkv_bias": true,
|
| 160 |
+
"remove_invalid_values": false,
|
| 161 |
+
"repetition_penalty": 1.0,
|
| 162 |
+
"return_dict": true,
|
| 163 |
+
"return_dict_in_generate": false,
|
| 164 |
+
"sep_token_id": null,
|
| 165 |
+
"suppress_tokens": null,
|
| 166 |
+
"task_specific_params": null,
|
| 167 |
+
"temperature": 1.0,
|
| 168 |
+
"tf_legacy_loss": false,
|
| 169 |
+
"tie_encoder_decoder": false,
|
| 170 |
+
"tie_word_embeddings": true,
|
| 171 |
+
"tokenizer_class": null,
|
| 172 |
+
"top_k": 50,
|
| 173 |
+
"top_p": 1.0,
|
| 174 |
+
"torch_dtype": null,
|
| 175 |
+
"torchscript": false,
|
| 176 |
+
"typical_p": 1.0,
|
| 177 |
+
"use_bfloat16": false
|
| 178 |
+
},
|
| 179 |
+
"eos_token_id": 50256,
|
| 180 |
+
"is_encoder_decoder": true,
|
| 181 |
+
"model_type": "vision-encoder-decoder",
|
| 182 |
+
"pad_token_id": 50256,
|
| 183 |
+
"tie_word_embeddings": false,
|
| 184 |
+
"transformers_version": "4.33.2"
|
| 185 |
+
}
|
ViT-GPT2-FlowerCaptioner-ONNX/generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"decoder_start_token_id": 50256,
|
| 3 |
+
"eos_token_id": 50256,
|
| 4 |
+
"max_new_tokens": 128,
|
| 5 |
+
"pad_token_id": 50256,
|
| 6 |
+
"transformers_version": "4.33.2"
|
| 7 |
+
}
|
ViT-GPT2-FlowerCaptioner-ONNX/merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f51820bb5c0f5a4ed7a56f8cebc0941ea4e76cbcd8b92029e6a692fb01e5a078
|
| 3 |
+
size 613153019
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model_merged.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc7e62770352f6844e064cdf22cabb6b00c8f7d166c0839e07156f7d2bae73c5
|
| 3 |
+
size 615070521
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model_merged_quantized.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b482ca61962a11ddd30d2a279a5680feedb4cc19e207fee8c2d29860e548deda
|
| 3 |
+
size 158063351
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_model_quantized.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81802b5229986a911d3ad6e9007fb540702b3ee6b42cbb8e687b816dfd948712
|
| 3 |
+
size 155710792
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_with_past_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8e6cb92689b1b31c3a6f9e4f04e8cf052e6f00e1b433553dc399f4df833ea01
|
| 3 |
+
size 613149344
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/decoder_with_past_model_quantized.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bcac5392f1f43d1fb64a0c4c4a9d8e32cc87d88213905997f43e72e73e660750
|
| 3 |
+
size 155701341
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/encoder_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d18e307852a5dca94a0e2d2457e4eb3d397820ca509caa7d80aac41fba4b9aa
|
| 3 |
+
size 343410667
|
ViT-GPT2-FlowerCaptioner-ONNX/onnx/encoder_model_quantized.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e7f417ac897abb1ab3f6df34df104737f9da1beb7ecafab5798bbb128fd9f90e
|
| 3 |
+
size 87000254
|
ViT-GPT2-FlowerCaptioner-ONNX/preprocessor_config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"do_rescale": true,
|
| 4 |
+
"do_resize": true,
|
| 5 |
+
"feature_extractor_type": "ViTFeatureExtractor",
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.5,
|
| 8 |
+
0.5,
|
| 9 |
+
0.5
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "ViTFeatureExtractor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"resample": 2,
|
| 18 |
+
"rescale_factor": 0.00392156862745098,
|
| 19 |
+
"size": {
|
| 20 |
+
"height": 224,
|
| 21 |
+
"width": 224
|
| 22 |
+
}
|
| 23 |
+
}
|
ViT-GPT2-FlowerCaptioner-ONNX/quantize_config.json
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"per_channel": false,
|
| 3 |
+
"reduce_range": false,
|
| 4 |
+
"per_model_config": {
|
| 5 |
+
"decoder_model": {
|
| 6 |
+
"op_types": [
|
| 7 |
+
"Pow",
|
| 8 |
+
"Split",
|
| 9 |
+
"Softmax",
|
| 10 |
+
"Reshape",
|
| 11 |
+
"Range",
|
| 12 |
+
"Slice",
|
| 13 |
+
"Mul",
|
| 14 |
+
"Constant",
|
| 15 |
+
"Gemm",
|
| 16 |
+
"Shape",
|
| 17 |
+
"Sub",
|
| 18 |
+
"Concat",
|
| 19 |
+
"Tanh",
|
| 20 |
+
"ConstantOfShape",
|
| 21 |
+
"LayerNormalization",
|
| 22 |
+
"Cast",
|
| 23 |
+
"Squeeze",
|
| 24 |
+
"Where",
|
| 25 |
+
"Div",
|
| 26 |
+
"Gather",
|
| 27 |
+
"Transpose",
|
| 28 |
+
"MatMul",
|
| 29 |
+
"Unsqueeze",
|
| 30 |
+
"Add"
|
| 31 |
+
],
|
| 32 |
+
"weight_type": "QInt8"
|
| 33 |
+
},
|
| 34 |
+
"decoder_model_merged": {
|
| 35 |
+
"op_types": [
|
| 36 |
+
"Pow",
|
| 37 |
+
"If",
|
| 38 |
+
"Split",
|
| 39 |
+
"Softmax",
|
| 40 |
+
"Reshape",
|
| 41 |
+
"Range",
|
| 42 |
+
"Slice",
|
| 43 |
+
"Mul",
|
| 44 |
+
"Constant",
|
| 45 |
+
"Gemm",
|
| 46 |
+
"Shape",
|
| 47 |
+
"Sub",
|
| 48 |
+
"Concat",
|
| 49 |
+
"Tanh",
|
| 50 |
+
"ConstantOfShape",
|
| 51 |
+
"LayerNormalization",
|
| 52 |
+
"Cast",
|
| 53 |
+
"Squeeze",
|
| 54 |
+
"Where",
|
| 55 |
+
"Div",
|
| 56 |
+
"Gather",
|
| 57 |
+
"Transpose",
|
| 58 |
+
"MatMul",
|
| 59 |
+
"Unsqueeze",
|
| 60 |
+
"Add"
|
| 61 |
+
],
|
| 62 |
+
"weight_type": "QInt8"
|
| 63 |
+
},
|
| 64 |
+
"decoder_with_past_model": {
|
| 65 |
+
"op_types": [
|
| 66 |
+
"Pow",
|
| 67 |
+
"Split",
|
| 68 |
+
"Softmax",
|
| 69 |
+
"Reshape",
|
| 70 |
+
"Range",
|
| 71 |
+
"Slice",
|
| 72 |
+
"Mul",
|
| 73 |
+
"Constant",
|
| 74 |
+
"Gemm",
|
| 75 |
+
"Shape",
|
| 76 |
+
"Sub",
|
| 77 |
+
"Concat",
|
| 78 |
+
"Tanh",
|
| 79 |
+
"ConstantOfShape",
|
| 80 |
+
"LayerNormalization",
|
| 81 |
+
"Cast",
|
| 82 |
+
"Squeeze",
|
| 83 |
+
"Where",
|
| 84 |
+
"Div",
|
| 85 |
+
"Gather",
|
| 86 |
+
"Transpose",
|
| 87 |
+
"MatMul",
|
| 88 |
+
"Unsqueeze",
|
| 89 |
+
"Add"
|
| 90 |
+
],
|
| 91 |
+
"weight_type": "QInt8"
|
| 92 |
+
},
|
| 93 |
+
"encoder_model": {
|
| 94 |
+
"op_types": [
|
| 95 |
+
"Softmax",
|
| 96 |
+
"Reshape",
|
| 97 |
+
"Conv",
|
| 98 |
+
"Expand",
|
| 99 |
+
"Slice",
|
| 100 |
+
"MatMul",
|
| 101 |
+
"Mul",
|
| 102 |
+
"Constant",
|
| 103 |
+
"Erf",
|
| 104 |
+
"Shape",
|
| 105 |
+
"Concat",
|
| 106 |
+
"ConstantOfShape",
|
| 107 |
+
"LayerNormalization",
|
| 108 |
+
"Equal",
|
| 109 |
+
"Where",
|
| 110 |
+
"Gather",
|
| 111 |
+
"Transpose",
|
| 112 |
+
"Div",
|
| 113 |
+
"Unsqueeze",
|
| 114 |
+
"Add"
|
| 115 |
+
],
|
| 116 |
+
"weight_type": "QUInt8"
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
}
|
ViT-GPT2-FlowerCaptioner-ONNX/source.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
https://huggingface.co/cristianglezm/ViT-GPT2-FlowerCaptioner-ONNX
|
ViT-GPT2-FlowerCaptioner-ONNX/special_tokens_map.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<|endoftext|>",
|
| 3 |
+
"eos_token": "<|endoftext|>",
|
| 4 |
+
"pad_token": "<|endoftext|>",
|
| 5 |
+
"unk_token": "<|endoftext|>"
|
| 6 |
+
}
|
ViT-GPT2-FlowerCaptioner-ONNX/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
ViT-GPT2-FlowerCaptioner-ONNX/tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"bos_token": "<|endoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": true,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"max_length": 32,
|
| 7 |
+
"model_max_length": 1024,
|
| 8 |
+
"pad_to_multiple_of": null,
|
| 9 |
+
"pad_token": "<|endoftext|>",
|
| 10 |
+
"pad_token_type_id": 0,
|
| 11 |
+
"padding_side": "right",
|
| 12 |
+
"stride": 0,
|
| 13 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 14 |
+
"truncation_side": "right",
|
| 15 |
+
"truncation_strategy": "longest_first",
|
| 16 |
+
"unk_token": "<|endoftext|>"
|
| 17 |
+
}
|
ViT-GPT2-FlowerCaptioner-ONNX/vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|