LeDissolution commited on
Commit
3baa463
·
verified ·
1 Parent(s): bd4d5e7

EmbeddingGemma 2 Gewell bundle (text, vision, audio)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
 
 
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
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - google/embeddinggemma-2
5
+ pipeline_tag: feature-extraction
6
+ tags:
7
+ - embeddinggemma
8
+ - embedding
9
+ - gewell
10
+ - bf16
11
+ - multimodal-embedding
12
+ - vision
13
+ - audio
14
+ - video
15
+ ---
16
+
17
+ # EmbeddingGemma 2 — Gewell
18
+
19
+ This is the EmbeddingGemma 2 bundle used by
20
+ [Gewell](https://github.com/LeDissolution/gewell), a single-GPU inference
21
+ engine specialized for NVIDIA Blackwell (`sm_120`/`sm_120a`). It is a lossless
22
+ BF16 repack of `google/embeddinggemma-2` into Gewell's native embedding layout,
23
+ split into separately loadable text, vision and audio components. It is not a
24
+ Transformers, Sentence Transformers, vLLM, or llama.cpp checkpoint.
25
+
26
+ ## Bundle contents
27
+
28
+ | File | Bytes | SHA-256 |
29
+ |---|---:|---|
30
+ | `text.safetensors` | 542,056,504 | `84bfdbbc9d5fe6dced9fd3b572329416fe2794c9c9e3a157346bc29b7c7ff361` |
31
+ | `vision.safetensors` | 335,543,360 | `2a146e1979e1fa9ac660aa871a2b405b92a0224b938ab4573dced85b1e43d600` |
32
+ | `audio.safetensors` | 611,314,696 | `ca511bf78d93dfc5b9d72bd61574e36087188a357e86f6fdbe65e034ae595017` |
33
+ | `config.json` | 4,455 | `b8f1e9931b57fbc054acdb445c41765d55b0074c58d145fa82839941ad1b5bb3` |
34
+ | `processor_config.json` | 1,788 | `168f6a08522f3ce5dea596d94d003af2fd691742d4f41fe1f9d8cce76bfbf69c` |
35
+ | `tokenizer.json` | 32,170,510 | `4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4` |
36
+
37
+ The components hold 413 text, 211 vision/bridge and 752 audio/bridge tensors
38
+ (1,376 total). Tensor values are copied without conversion; native startup
39
+ validates the configuration, tokenizer, processor contract and tensor
40
+ inventory of every loaded component.
41
+
42
+ ## Download and launch
43
+
44
+ Follow the [Gewell build instructions](https://github.com/LeDissolution/gewell/blob/main/docs/build.md),
45
+ then download this repository:
46
+
47
+ ```bash
48
+ MODEL_DIR=/absolute/path/to/EmbeddingGemma-2-Gewell
49
+
50
+ hf download LeDissolution/EmbeddingGemma-2-Gewell --local-dir "$MODEL_DIR"
51
+
52
+ build/gewell serve-embeddings "$MODEL_DIR" --vision --audio
53
+ ```
54
+
55
+ The server listens on `127.0.0.1:6311` and serves the OpenAI-compatible
56
+ `POST /v1/embeddings` endpoint under the model ID `google/embeddinggemma-2`:
57
+
58
+ ```bash
59
+ curl -s http://127.0.0.1:6311/v1/embeddings \
60
+ -H 'Content-Type: application/json' \
61
+ -d '{"model":"google/embeddinggemma-2","input":["task: search result | query: What causes auroras?","title: none | text: Charged particles from the sun cause auroras."],"dimensions":768}'
62
+ ```
63
+
64
+ Text is always loaded. `--vision` adds image and video input; `--audio` adds
65
+ audio input. Mixed image/video and audio requests need both. Explicit GPU
66
+ allocations at the default 8192-token capacity, excluding CUDA/cuBLAS/cuDNN
67
+ overhead:
68
+
69
+ | Options | Weight bytes | Scratch bytes |
70
+ |---|---:|---:|
71
+ | text only | 274,210,816 | 167,773,696 |
72
+ | `--vision` | 610,017,280 | 178,782,528 |
73
+ | `--vision --audio` | 1,223,507,968 | 1,028,441,648 |
74
+
75
+ The token-embedding table stays in host memory. Inputs support up to 8192
76
+ tokens including BOS/EOS and 128/256/512/768 output dimensions. Task prefixes
77
+ are not inserted automatically; supply them as described in the upstream
78
+ model card.
79
+
80
+ The engine was developed and tested on an RTX PRO 6000 Blackwell. See the
81
+ [model guide](https://github.com/LeDissolution/gewell/blob/main/docs/models.md),
82
+ [CLI reference](https://github.com/LeDissolution/gewell/blob/main/docs/cli.md)
83
+ and [HTTP API documentation](https://github.com/LeDissolution/gewell/blob/main/docs/http-api.md)
84
+ for request formats, media limits and serving options.
85
+
86
+ ## Scope and provenance
87
+
88
+ This repository was created with
89
+
90
+ ```bash
91
+ python3 tools/extract_embeddinggemma2.py --snapshot SNAPSHOT --vision --audio --output MODEL_DIR
92
+ ```
93
+
94
+ from `google/embeddinggemma-2` at revision
95
+ `914f7f89142e33e77833254d9c9b90c3cef7303b`. Extraction is deterministic; you
96
+ can reproduce these files from the upstream snapshot instead of downloading
97
+ them.
98
+
99
+ Use is subject to the upstream
100
+ [EmbeddingGemma 2 license and terms](https://huggingface.co/google/embeddinggemma-2).
audio.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca511bf78d93dfc5b9d72bd61574e36087188a357e86f6fdbe65e034ae595017
3
+ size 611314696
config.json ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "EmbeddingGemma2Model"
4
+ ],
5
+ "audio_config": {
6
+ "_name_or_path": "",
7
+ "architectures": null,
8
+ "attention_chunk_size": 12,
9
+ "attention_context_left": 13,
10
+ "attention_context_right": 0,
11
+ "attention_invalid_logits_value": -1000000000.0,
12
+ "attention_logit_cap": 50.0,
13
+ "chunk_size_feed_forward": 0,
14
+ "conv_kernel_size": 5,
15
+ "dtype": "bfloat16",
16
+ "gradient_clipping": 10000000000.0,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 1024,
19
+ "id2label": {
20
+ "0": "LABEL_0",
21
+ "1": "LABEL_1"
22
+ },
23
+ "initializer_range": 0.02,
24
+ "is_encoder_decoder": false,
25
+ "label2id": {
26
+ "LABEL_0": 0,
27
+ "LABEL_1": 1
28
+ },
29
+ "model_type": "gemma4_audio",
30
+ "num_attention_heads": 8,
31
+ "num_hidden_layers": 12,
32
+ "output_attentions": false,
33
+ "output_hidden_states": false,
34
+ "output_proj_dims": 1536,
35
+ "problem_type": null,
36
+ "residual_weight": 0.5,
37
+ "return_dict": true,
38
+ "rms_norm_eps": 1e-06,
39
+ "subsampling_conv_channels": [
40
+ 128,
41
+ 32
42
+ ],
43
+ "use_clipped_linears": true
44
+ },
45
+ "audio_token_id": 258881,
46
+ "boa_token_id": 256000,
47
+ "boi_token_id": 255999,
48
+ "dtype": "bfloat16",
49
+ "eoa_token_index": 258883,
50
+ "eoi_token_id": 258882,
51
+ "image_token_id": 258880,
52
+ "initializer_range": 0.02,
53
+ "model_type": "embedding_gemma2",
54
+ "text_config": {
55
+ "attention_bias": false,
56
+ "attention_dropout": 0.0,
57
+ "bos_token_id": 2,
58
+ "dtype": "bfloat16",
59
+ "embedding_dim": 768,
60
+ "eos_token_id": 1,
61
+ "head_dim": 256,
62
+ "hidden_activation": "gelu_pytorch_tanh",
63
+ "hidden_size": 512,
64
+ "hidden_size_per_layer_input": 512,
65
+ "initializer_range": 0.02,
66
+ "intermediate_size": 2048,
67
+ "layer_types": [
68
+ "sliding_attention",
69
+ "sliding_attention",
70
+ "sliding_attention",
71
+ "sliding_attention",
72
+ "sliding_attention",
73
+ "full_attention",
74
+ "sliding_attention",
75
+ "sliding_attention",
76
+ "sliding_attention",
77
+ "sliding_attention",
78
+ "sliding_attention",
79
+ "full_attention",
80
+ "sliding_attention",
81
+ "sliding_attention",
82
+ "sliding_attention",
83
+ "sliding_attention",
84
+ "sliding_attention",
85
+ "full_attention",
86
+ "sliding_attention",
87
+ "sliding_attention",
88
+ "sliding_attention",
89
+ "sliding_attention",
90
+ "sliding_attention",
91
+ "full_attention"
92
+ ],
93
+ "max_position_embeddings": 262144,
94
+ "model_type": "embedding_gemma2_text",
95
+ "num_attention_heads": 4,
96
+ "num_hidden_layers": 24,
97
+ "num_key_value_heads": 2,
98
+ "pad_token_id": 0,
99
+ "per_layer_config": {
100
+ "05": {
101
+ "head_dim": 512,
102
+ "num_key_value_heads": 1
103
+ },
104
+ "11": {
105
+ "head_dim": 512,
106
+ "num_key_value_heads": 1
107
+ },
108
+ "17": {
109
+ "head_dim": 512,
110
+ "num_key_value_heads": 1
111
+ },
112
+ "23": {
113
+ "head_dim": 512,
114
+ "num_key_value_heads": 1
115
+ }
116
+ },
117
+ "rms_norm_eps": 1e-06,
118
+ "rope_parameters": {
119
+ "full_attention": {
120
+ "rope_theta": 1000000.0,
121
+ "rope_type": "default"
122
+ },
123
+ "sliding_attention": {
124
+ "rope_theta": 10000.0,
125
+ "rope_type": "default"
126
+ }
127
+ },
128
+ "sliding_window": 512,
129
+ "vocab_size": 262144
130
+ },
131
+ "transformers_version": "5.18.0.dev0",
132
+ "video_token_id": 258884,
133
+ "vision_config": {
134
+ "_name_or_path": "",
135
+ "architectures": null,
136
+ "attention_bias": false,
137
+ "attention_dropout": 0.0,
138
+ "chunk_size_feed_forward": 0,
139
+ "default_output_length": 280,
140
+ "dtype": "bfloat16",
141
+ "global_head_dim": 64,
142
+ "head_dim": 64,
143
+ "hidden_activation": "gelu_pytorch_tanh",
144
+ "hidden_size": 768,
145
+ "id2label": {
146
+ "0": "LABEL_0",
147
+ "1": "LABEL_1"
148
+ },
149
+ "initializer_range": 0.02,
150
+ "intermediate_size": 3072,
151
+ "is_encoder_decoder": false,
152
+ "label2id": {
153
+ "LABEL_0": 0,
154
+ "LABEL_1": 1
155
+ },
156
+ "max_position_embeddings": 131072,
157
+ "model_type": "gemma4_vision",
158
+ "num_attention_heads": 12,
159
+ "num_hidden_layers": 16,
160
+ "num_key_value_heads": 12,
161
+ "output_attentions": false,
162
+ "output_hidden_states": false,
163
+ "patch_size": 16,
164
+ "pooling_kernel_size": 3,
165
+ "position_embedding_size": 10240,
166
+ "problem_type": null,
167
+ "return_dict": true,
168
+ "rms_norm_eps": 1e-06,
169
+ "rope_parameters": {
170
+ "rope_theta": 100.0,
171
+ "rope_type": "axial"
172
+ },
173
+ "standardize": false,
174
+ "use_clipped_linears": false
175
+ },
176
+ "vision_soft_tokens_per_image": 280
177
+ }
processor_config.json ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_ms_per_token": 40,
3
+ "audio_seq_length": 280,
4
+ "feature_extractor": {
5
+ "dither": 0.0,
6
+ "feature_extractor_type": "Gemma4AudioFeatureExtractor",
7
+ "feature_size": 128,
8
+ "fft_length": 512,
9
+ "fft_overdrive": false,
10
+ "frame_length": 320,
11
+ "hop_length": 160,
12
+ "input_scale_factor": 1.0,
13
+ "max_frequency": 8000.0,
14
+ "mel_floor": 0.001,
15
+ "min_frequency": 0.0,
16
+ "padding_side": "right",
17
+ "padding_value": 0.0,
18
+ "per_bin_mean": null,
19
+ "per_bin_stddev": null,
20
+ "preemphasis": 0.0,
21
+ "preemphasis_htk_flavor": true,
22
+ "return_attention_mask": true,
23
+ "sampling_rate": 16000
24
+ },
25
+ "image_processor": {
26
+ "do_convert_rgb": true,
27
+ "do_normalize": false,
28
+ "do_rescale": true,
29
+ "do_resize": true,
30
+ "image_mean": [
31
+ 0.0,
32
+ 0.0,
33
+ 0.0
34
+ ],
35
+ "image_processor_type": "Gemma4ImageProcessor",
36
+ "image_seq_length": 280,
37
+ "image_std": [
38
+ 1.0,
39
+ 1.0,
40
+ 1.0
41
+ ],
42
+ "max_soft_tokens": 280,
43
+ "patch_size": 16,
44
+ "pooling_kernel_size": 3,
45
+ "resample": 3,
46
+ "rescale_factor": 0.00392156862745098
47
+ },
48
+ "image_seq_length": 280,
49
+ "processor_class": "EmbeddingGemma2Processor",
50
+ "video_processor": {
51
+ "add_timestamps": false,
52
+ "do_convert_rgb": true,
53
+ "do_normalize": false,
54
+ "do_rescale": true,
55
+ "do_resize": true,
56
+ "do_sample_frames": true,
57
+ "fps": 1,
58
+ "image_mean": [
59
+ 0.0,
60
+ 0.0,
61
+ 0.0
62
+ ],
63
+ "image_std": [
64
+ 1.0,
65
+ 1.0,
66
+ 1.0
67
+ ],
68
+ "max_frames": 32,
69
+ "max_soft_tokens": 140,
70
+ "overflow_strategy": "uniform",
71
+ "patch_size": 16,
72
+ "pooling_kernel_size": 3,
73
+ "resample": 3,
74
+ "rescale_factor": 0.00392156862745098,
75
+ "return_metadata": false,
76
+ "video_processor_type": "EmbeddingGemma2VideoProcessor"
77
+ }
78
+ }
text.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84bfdbbc9d5fe6dced9fd3b572329416fe2794c9c9e3a157346bc29b7c7ff361
3
+ size 542056504
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4
3
+ size 32170510
vision.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a146e1979e1fa9ac660aa871a2b405b92a0224b938ab4573dced85b1e43d600
3
+ size 335543360