Upload folder using huggingface_hub
Browse files- config.json +26 -0
- configuration_aimv2.py +62 -0
- model.safetensors +3 -0
config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "checkpoints/aimv2-large-patch14-224/",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"AIMv2Model"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_aimv2.AIMv2Config",
|
| 9 |
+
"AutoModel": "modeling_aimv2.AIMv2Model",
|
| 10 |
+
"FlaxAutoModel": "modeling_flax_aimv2.FlaxAIMv2Model"
|
| 11 |
+
},
|
| 12 |
+
"hidden_size": 1024,
|
| 13 |
+
"image_size": 224,
|
| 14 |
+
"intermediate_size": 2816,
|
| 15 |
+
"model_type": "aimv2",
|
| 16 |
+
"num_attention_heads": 8,
|
| 17 |
+
"num_channels": 3,
|
| 18 |
+
"num_hidden_layers": 24,
|
| 19 |
+
"patch_size": 14,
|
| 20 |
+
"projection_dropout": 0.0,
|
| 21 |
+
"qkv_bias": false,
|
| 22 |
+
"rms_norm_eps": 1e-05,
|
| 23 |
+
"torch_dtype": "bfloat16",
|
| 24 |
+
"transformers_version": "4.47.1",
|
| 25 |
+
"use_bias": false
|
| 26 |
+
}
|
configuration_aimv2.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
|
| 3 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 4 |
+
|
| 5 |
+
__all__ = ["AIMv2Config"]
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class AIMv2Config(PretrainedConfig):
|
| 9 |
+
"""This is the configuration class to store the configuration of an [`AIMv2Model`].
|
| 10 |
+
|
| 11 |
+
Instantiating a configuration with the defaults will yield a similar configuration
|
| 12 |
+
to that of the [apple/aimv2-large-patch14-224](https://huggingface.co/apple/aimv2-large-patch14-224).
|
| 13 |
+
|
| 14 |
+
Args:
|
| 15 |
+
hidden_size: Dimension of the hidden representations.
|
| 16 |
+
intermediate_size: Dimension of the SwiGLU representations.
|
| 17 |
+
num_hidden_layers: Number of hidden layers in the Transformer.
|
| 18 |
+
num_attention_heads: Number of attention heads for each attention layer
|
| 19 |
+
in the Transformer.
|
| 20 |
+
num_channels: Number of input channels.
|
| 21 |
+
image_size: Image size.
|
| 22 |
+
patch_size: Patch size.
|
| 23 |
+
rms_norm_eps: Epsilon value used for the RMS normalization layer.
|
| 24 |
+
attention_dropout: Dropout ratio for attention probabilities.
|
| 25 |
+
projection_dropout: Dropout ratio for the projection layer after the attention.
|
| 26 |
+
qkv_bias: Whether to add a bias to the queries, keys and values.
|
| 27 |
+
use_bias: Whether to add a bias in the feed-forward and projection layers.
|
| 28 |
+
kwargs: Keyword arguments for the [`PretrainedConfig`].
|
| 29 |
+
"""
|
| 30 |
+
|
| 31 |
+
model_type: str = "aimv2"
|
| 32 |
+
|
| 33 |
+
def __init__(
|
| 34 |
+
self,
|
| 35 |
+
hidden_size: int = 1024,
|
| 36 |
+
intermediate_size: int = 2816,
|
| 37 |
+
num_hidden_layers: int = 24,
|
| 38 |
+
num_attention_heads: int = 8,
|
| 39 |
+
num_channels: int = 3,
|
| 40 |
+
image_size: int = 224,
|
| 41 |
+
patch_size: int = 14,
|
| 42 |
+
rms_norm_eps: float = 1e-5,
|
| 43 |
+
attention_dropout: float = 0.0,
|
| 44 |
+
projection_dropout: float = 0.0,
|
| 45 |
+
qkv_bias: bool = False,
|
| 46 |
+
use_bias: bool = False,
|
| 47 |
+
**kwargs: Any,
|
| 48 |
+
):
|
| 49 |
+
super().__init__(**kwargs)
|
| 50 |
+
self.hidden_size = hidden_size
|
| 51 |
+
self.intermediate_size = intermediate_size
|
| 52 |
+
self.num_hidden_layers = num_hidden_layers
|
| 53 |
+
self.num_attention_heads = num_attention_heads
|
| 54 |
+
self.num_channels = num_channels
|
| 55 |
+
self.patch_size = patch_size
|
| 56 |
+
self.image_size = image_size
|
| 57 |
+
self.attention_dropout = attention_dropout
|
| 58 |
+
self.rms_norm_eps = rms_norm_eps
|
| 59 |
+
|
| 60 |
+
self.projection_dropout = projection_dropout
|
| 61 |
+
self.qkv_bias = qkv_bias
|
| 62 |
+
self.use_bias = use_bias
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29b287f42146349615a47c0f70052749bf7e28a6cd0966f10b846a14e9daba97
|
| 3 |
+
size 618413824
|