Feature Extraction
MLX
Safetensors
embedding_gemma2
embeddings
sentence-similarity
quantized
krill
8bit
embedding
multimodal-embedding
multimodal
vision
audio
video
apple-silicon
8-bit precision
Instructions to use srv-sngh/embeddinggemma-2-mlx-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use srv-sngh/embeddinggemma-2-mlx-8bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download srv-sngh/embeddinggemma-2-mlx-8bit --local-dir embeddinggemma-2-mlx-8bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Add EmbeddingGemma 2 MLX build
Browse files- .gitattributes +1 -0
- 1_Pooling/config.json +5 -0
- 2_Normalize/config.json +4 -0
- README.md +82 -0
- chat_template.jinja +1 -0
- config.json +185 -0
- config_sentence_transformers.json +38 -0
- model.safetensors +3 -0
- modules.json +20 -0
- preprocessor_config.json +21 -0
- processor_config.json +78 -0
- sentence_bert_config.json +27 -0
- tokenizer.json +3 -0
- tokenizer.model +3 -0
- tokenizer_config.json +57 -0
.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
|
1_Pooling/config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"embedding_dimension": 768,
|
| 3 |
+
"pooling_mode": "mean",
|
| 4 |
+
"include_prompt": true
|
| 5 |
+
}
|
2_Normalize/config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"module_input_name": "sentence_embedding",
|
| 3 |
+
"module_output_name": "sentence_embedding"
|
| 4 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: google/embeddinggemma-2
|
| 3 |
+
library_name: mlx
|
| 4 |
+
pipeline_tag: sentence-similarity
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
tags:
|
| 7 |
+
- mlx
|
| 8 |
+
- embeddings
|
| 9 |
+
- sentence-similarity
|
| 10 |
+
- quantized
|
| 11 |
+
- krill
|
| 12 |
+
- 8bit
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# EmbeddingGemma 2, MLX 8bit
|
| 16 |
+
|
| 17 |
+
A quantized MLX build of [google/embeddinggemma-2](https://huggingface.co/google/embeddinggemma-2) (740M parameters; text, image, audio and video embeddings in one `model.safetensors`), made with [Krill](https://github.com/srvsngh99/Krill). Bits: **8**. Weights file: **806.2 MB** (bf16 original: 1488.9 MB).
|
| 18 |
+
|
| 19 |
+
## What this build is
|
| 20 |
+
|
| 21 |
+
Affine 8-bit quantization, group size 64, applied to every quantizable tensor.
|
| 22 |
+
|
| 23 |
+
Produced with:
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
krill quantize <bf16-dir> --bits 8 --group-size 64 --dtype bf16 --output-dir <out>
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
Gate result: **PASS** (8-bit class). Drops against bf16: SciFact -0.03, Hindi -0.03, image R@1 0.0 points (negative means the build scored higher). Gate: SciFact and Hindi drop <= 1.0 nDCG point, image R@1 drop <= 1.0 point (variants: mixed-mxfp8, 8bit, 6bit, 6bit-dyn).
|
| 30 |
+
|
| 31 |
+
## Quality against bf16
|
| 32 |
+
|
| 33 |
+
Cosine similarity is measured against Google's fp32 sentence-transformers reference vectors; retrieval is nDCG@10 or Recall@k. The bf16 column is the unmodified Google weights run through Krill.
|
| 34 |
+
|
| 35 |
+
| metric | bf16 | this build |
|
| 36 |
+
|---|---|---|
|
| 37 |
+
| Text cosine to Google fp32 (min / mean) | 1.000 / 1.000 | 1.000 / 1.000 |
|
| 38 |
+
| Image cosine (min / mean) | 0.999 / 1.000 | 0.999 / 1.000 |
|
| 39 |
+
| Mixed cosine (min / mean) | 1.000 / 1.000 | 0.999 / 1.000 |
|
| 40 |
+
| Audio cosine (min / mean) | 1.000 / 1.000 | 1.000 / 1.000 |
|
| 41 |
+
| Video cosine (min / mean) | 0.999 / 1.000 | 0.999 / 1.000 |
|
| 42 |
+
| SciFact nDCG@10, 768 d | 86.92 | 86.95 |
|
| 43 |
+
| SciFact nDCG@10, 256 d | 84.44 | 84.32 |
|
| 44 |
+
| Hindi nDCG@10 (IndicQARetrieval) | 72.78 | 72.81 |
|
| 45 |
+
| Kannada nDCG@10 (IndicQARetrieval) | 73.25 | 73.25 |
|
| 46 |
+
| Flickr image-to-text R@1 / R@5 | 99.5 / 100.0 | 99.5 / 100.0 |
|
| 47 |
+
| Flickr text-to-image R@1 / R@5 | 96.1 / 99.7 | 96.1 / 99.7 |
|
| 48 |
+
| Clotho audio-to-text R@1 / R@5 | 25.0 / 61.7 | 23.3 / 58.3 |
|
| 49 |
+
| Clotho text-to-audio R@1 / R@5 | 30.0 / 58.3 | 30.0 / 55.0 |
|
| 50 |
+
| Ranking agreement, Spearman raw / Document | 1.000 / 1.000 | 1.000 / 1.000 |
|
| 51 |
+
| Top-1 neighbour unchanged, raw / Document (of 21) | 21 / 21 | 21 / 20 |
|
| 52 |
+
|
| 53 |
+
SciFact is MTEB `mteb/scifact` (300 queries, 5,183 documents). Hindi and Kannada are the `hi` and `kn` splits of MTEB `IndicQARetrieval`; the corpora are small, so treat differences under about 0.5 point as noise. Flickr is the first 200 images of the Flickr30k 1K test split. Clotho is 60 clips of the Clotho v2 test split (one clip is 1.7 points of Recall@1). Test sets are small; "PASS" means no measurable loss on these sets, not "equal".
|
| 54 |
+
|
| 55 |
+
## Speed and memory (Apple M4 Pro)
|
| 56 |
+
|
| 57 |
+
| contender | weights MB | single query p50 ms | batch-32 ~256 tok docs/s | batch-32 ~1k tok docs/s | peak memory MB |
|
| 58 |
+
|---|---|---|---|---|---|
|
| 59 |
+
| Krill bf16 (fp32 compute) | 1488.9 | 10.2 | 39 | 9 | 3234 |
|
| 60 |
+
| Krill 8bit (this build) | 806.2 | 8.8 | 37 | 8 | 2498 |
|
| 61 |
+
| Google sentence-transformers, MPS bf16 | 1488.9 | 26.2 | 26 | 5 | 17283 |
|
| 62 |
+
| Ollama `embeddinggemma-2` (nvfp4, 1.3 GB with towers) | 1300 | 25.2 | 32 | 8 | 1476 |
|
| 63 |
+
| Unsloth Q8_0 GGUF (text only, llama.cpp Metal) | 309.9 | 16.4 | 33 | 7 | 1825 |
|
| 64 |
+
|
| 65 |
+
Unsloth and Ollama are text only; Krill rows include the vision and audio towers in the weights. Image encoding for this build: 382 ms p50 for one 640x480 PNG. Cold first request: 1086 ms. Single-query p95: 12.9 ms.
|
| 66 |
+
|
| 67 |
+
Method: Apple M4 Pro, 24 GB. One contender at a time, with the server started and stopped for every repetition, 10 discarded warm-up requests, and 3 repetitions per metric reported as the median. Before each repetition the harness required 1-minute load below 3, at least 50% free memory, no thermal limit and AC power. A contender counts as stable when the spread (max - min over the median) of every metric across its 3 repetitions is at most 10%; otherwise it was re-measured. Krill rows use fp32 compute (the default). Full protocol: `docs/bench/embeddinggemma2-2026-10-08.md` in the Krill repository.
|
| 68 |
+
|
| 69 |
+
## Usage with Krill
|
| 70 |
+
|
| 71 |
+
```
|
| 72 |
+
krill pull embeddinggemma-2-8bit
|
| 73 |
+
krill serve
|
| 74 |
+
curl localhost:57455/v1/embeddings -H 'Content-Type: application/json' \
|
| 75 |
+
-H "Authorization: Bearer $KRILL_API_KEY" -d '{"model":"embeddinggemma-2-8bit","input":"What causes the northern lights?","task":"SearchQuery"}'
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
Use `"task": "SearchQuery"` for queries and `"Document"` for documents. Dimensions: 768 (default), 512, 256, 128 (Matryoshka). Context: 8,192 tokens. Compute dtype: float32 (default) or bfloat16; float16 is not supported.
|
| 79 |
+
|
| 80 |
+
## Other builds
|
| 81 |
+
|
| 82 |
+
`mixed-mxfp8`, `8bit`, `6bit`, `6bit-dyn`, `5bit`, `4bit-g32`, `4bit-dyn`, `4bit-dyn-text` and `nvfp4`, all under `srv-sngh/embeddinggemma-2-mlx-<name>`.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{%- for msg in messages if msg.get('role') == 'system' -%}{%- if msg.get('content') is string -%}{{ msg['content'] }}{%- else -%}{%- for item in msg['content'] if item.get('type') == 'text' -%}{{ item['text'] }}{%- endfor -%}{%- endif -%}{%- endfor -%}{%- for msg in messages if msg.get('role') != 'system' -%}{%- if msg.get('content') is string -%}{{ msg['content'] }}{%- else -%}{%- set existing_text = msg['content'] | selectattr('type', 'equalto', 'text') | map(attribute='text') | join -%}{%- set has_manual_placeholders = ('<|image|>' in existing_text) or ('<|video|>' in existing_text) or ('<|audio|>' in existing_text) -%}{%- for item in msg['content'] -%}{%- if item.get('type') == 'text' -%}{{ item['text'] }}{%- elif not has_manual_placeholders and item.get('type') == 'image' -%}<|image|>{%- elif not has_manual_placeholders and item.get('type') == 'video' -%}<|video|>{%- elif not has_manual_placeholders and item.get('type') == 'audio' -%}<|audio|>{%- endif -%}{%- endfor -%}{%- endif -%}{%- endfor -%}
|
config.json
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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,
|
| 12 |
+
"attention_logit_cap" : 50,
|
| 13 |
+
"chunk_size_feed_forward" : 0,
|
| 14 |
+
"conv_kernel_size" : 5,
|
| 15 |
+
"dtype" : "bfloat16",
|
| 16 |
+
"gradient_clipping" : 10000000000,
|
| 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" : 9.9999999999999995e-07,
|
| 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 |
+
"quantization" : {
|
| 55 |
+
"bits" : 8,
|
| 56 |
+
"group_size" : 64
|
| 57 |
+
},
|
| 58 |
+
"quantization_config" : {
|
| 59 |
+
"bits" : 8,
|
| 60 |
+
"group_size" : 64
|
| 61 |
+
},
|
| 62 |
+
"text_config" : {
|
| 63 |
+
"attention_bias" : false,
|
| 64 |
+
"attention_dropout" : 0,
|
| 65 |
+
"bos_token_id" : 2,
|
| 66 |
+
"dtype" : "bfloat16",
|
| 67 |
+
"embedding_dim" : 768,
|
| 68 |
+
"eos_token_id" : 1,
|
| 69 |
+
"head_dim" : 256,
|
| 70 |
+
"hidden_activation" : "gelu_pytorch_tanh",
|
| 71 |
+
"hidden_size" : 512,
|
| 72 |
+
"hidden_size_per_layer_input" : 512,
|
| 73 |
+
"initializer_range" : 0.02,
|
| 74 |
+
"intermediate_size" : 2048,
|
| 75 |
+
"layer_types" : [
|
| 76 |
+
"sliding_attention",
|
| 77 |
+
"sliding_attention",
|
| 78 |
+
"sliding_attention",
|
| 79 |
+
"sliding_attention",
|
| 80 |
+
"sliding_attention",
|
| 81 |
+
"full_attention",
|
| 82 |
+
"sliding_attention",
|
| 83 |
+
"sliding_attention",
|
| 84 |
+
"sliding_attention",
|
| 85 |
+
"sliding_attention",
|
| 86 |
+
"sliding_attention",
|
| 87 |
+
"full_attention",
|
| 88 |
+
"sliding_attention",
|
| 89 |
+
"sliding_attention",
|
| 90 |
+
"sliding_attention",
|
| 91 |
+
"sliding_attention",
|
| 92 |
+
"sliding_attention",
|
| 93 |
+
"full_attention",
|
| 94 |
+
"sliding_attention",
|
| 95 |
+
"sliding_attention",
|
| 96 |
+
"sliding_attention",
|
| 97 |
+
"sliding_attention",
|
| 98 |
+
"sliding_attention",
|
| 99 |
+
"full_attention"
|
| 100 |
+
],
|
| 101 |
+
"max_position_embeddings" : 262144,
|
| 102 |
+
"model_type" : "embedding_gemma2_text",
|
| 103 |
+
"num_attention_heads" : 4,
|
| 104 |
+
"num_hidden_layers" : 24,
|
| 105 |
+
"num_key_value_heads" : 2,
|
| 106 |
+
"pad_token_id" : 0,
|
| 107 |
+
"per_layer_config" : {
|
| 108 |
+
"05" : {
|
| 109 |
+
"head_dim" : 512,
|
| 110 |
+
"num_key_value_heads" : 1
|
| 111 |
+
},
|
| 112 |
+
"11" : {
|
| 113 |
+
"head_dim" : 512,
|
| 114 |
+
"num_key_value_heads" : 1
|
| 115 |
+
},
|
| 116 |
+
"17" : {
|
| 117 |
+
"head_dim" : 512,
|
| 118 |
+
"num_key_value_heads" : 1
|
| 119 |
+
},
|
| 120 |
+
"23" : {
|
| 121 |
+
"head_dim" : 512,
|
| 122 |
+
"num_key_value_heads" : 1
|
| 123 |
+
}
|
| 124 |
+
},
|
| 125 |
+
"rms_norm_eps" : 9.9999999999999995e-07,
|
| 126 |
+
"rope_parameters" : {
|
| 127 |
+
"full_attention" : {
|
| 128 |
+
"rope_theta" : 1000000,
|
| 129 |
+
"rope_type" : "default"
|
| 130 |
+
},
|
| 131 |
+
"sliding_attention" : {
|
| 132 |
+
"rope_theta" : 10000,
|
| 133 |
+
"rope_type" : "default"
|
| 134 |
+
}
|
| 135 |
+
},
|
| 136 |
+
"sliding_window" : 512,
|
| 137 |
+
"vocab_size" : 262144
|
| 138 |
+
},
|
| 139 |
+
"transformers_version" : "5.18.0.dev0",
|
| 140 |
+
"video_token_id" : 258884,
|
| 141 |
+
"vision_config" : {
|
| 142 |
+
"_name_or_path" : "",
|
| 143 |
+
"architectures" : null,
|
| 144 |
+
"attention_bias" : false,
|
| 145 |
+
"attention_dropout" : 0,
|
| 146 |
+
"chunk_size_feed_forward" : 0,
|
| 147 |
+
"default_output_length" : 280,
|
| 148 |
+
"dtype" : "bfloat16",
|
| 149 |
+
"global_head_dim" : 64,
|
| 150 |
+
"head_dim" : 64,
|
| 151 |
+
"hidden_activation" : "gelu_pytorch_tanh",
|
| 152 |
+
"hidden_size" : 768,
|
| 153 |
+
"id2label" : {
|
| 154 |
+
"0" : "LABEL_0",
|
| 155 |
+
"1" : "LABEL_1"
|
| 156 |
+
},
|
| 157 |
+
"initializer_range" : 0.02,
|
| 158 |
+
"intermediate_size" : 3072,
|
| 159 |
+
"is_encoder_decoder" : false,
|
| 160 |
+
"label2id" : {
|
| 161 |
+
"LABEL_0" : 0,
|
| 162 |
+
"LABEL_1" : 1
|
| 163 |
+
},
|
| 164 |
+
"max_position_embeddings" : 131072,
|
| 165 |
+
"model_type" : "gemma4_vision",
|
| 166 |
+
"num_attention_heads" : 12,
|
| 167 |
+
"num_hidden_layers" : 16,
|
| 168 |
+
"num_key_value_heads" : 12,
|
| 169 |
+
"output_attentions" : false,
|
| 170 |
+
"output_hidden_states" : false,
|
| 171 |
+
"patch_size" : 16,
|
| 172 |
+
"pooling_kernel_size" : 3,
|
| 173 |
+
"position_embedding_size" : 10240,
|
| 174 |
+
"problem_type" : null,
|
| 175 |
+
"return_dict" : true,
|
| 176 |
+
"rms_norm_eps" : 9.9999999999999995e-07,
|
| 177 |
+
"rope_parameters" : {
|
| 178 |
+
"rope_theta" : 100,
|
| 179 |
+
"rope_type" : "axial"
|
| 180 |
+
},
|
| 181 |
+
"standardize" : false,
|
| 182 |
+
"use_clipped_linears" : false
|
| 183 |
+
},
|
| 184 |
+
"vision_soft_tokens_per_image" : 280
|
| 185 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"pytorch": "2.14.0+cu130",
|
| 4 |
+
"sentence_transformers": "6.1.0",
|
| 5 |
+
"transformers": "5.18.0.dev0"
|
| 6 |
+
},
|
| 7 |
+
"default_prompt_name": null,
|
| 8 |
+
"model_type": "SentenceTransformer",
|
| 9 |
+
"prompts": {
|
| 10 |
+
"BitextMining": "task: search result | query: ",
|
| 11 |
+
"Classification": "task: classification | query: ",
|
| 12 |
+
"Clustering": "task: clustering | query: ",
|
| 13 |
+
"CodeRetrieval": "task: code retrieval | query: ",
|
| 14 |
+
"Document": "title: none | text: ",
|
| 15 |
+
"FactChecking": "task: fact checking | query: ",
|
| 16 |
+
"InstructionRetrieval": "task: code retrieval | query: ",
|
| 17 |
+
"MultilabelClassification": "task: classification | query: ",
|
| 18 |
+
"PairClassification": "task: sentence similarity | query: ",
|
| 19 |
+
"QuestionAnswering": "task: question answering | query: ",
|
| 20 |
+
"Reranking": "task: search result | query: ",
|
| 21 |
+
"Retrieval": "task: search result | query: ",
|
| 22 |
+
"Retrieval-document": "title: none | text: ",
|
| 23 |
+
"Retrieval-query": "task: search result | query: ",
|
| 24 |
+
"STS": "task: sentence similarity | query: ",
|
| 25 |
+
"SearchQuery": "task: search result | query: ",
|
| 26 |
+
"SentenceSimilarity": "task: sentence similarity | query: ",
|
| 27 |
+
"Summarization": "task: sentence similarity | query: ",
|
| 28 |
+
"document": "title: none | text: ",
|
| 29 |
+
"query": "task: search result | query: "
|
| 30 |
+
},
|
| 31 |
+
"requirements": {
|
| 32 |
+
"sentence-transformers": {
|
| 33 |
+
"reason": "Older versions ignore the order of multimodal dict inputs and cannot put several images or texts into a single embedding.",
|
| 34 |
+
"specifier": ">=6.1.0"
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"similarity_fn_name": "cosine"
|
| 38 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:122319f6d385e0072e18dccd26b190b60959b2d6f97a28b62908120166e3622b
|
| 3 |
+
size 806249780
|
modules.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.base.modules.transformer.Transformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_Pooling",
|
| 12 |
+
"type": "sentence_transformers.sentence_transformer.modules.pooling.Pooling"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"idx": 2,
|
| 16 |
+
"name": "2",
|
| 17 |
+
"path": "2_Normalize",
|
| 18 |
+
"type": "sentence_transformers.base.modules.normalize.Normalize"
|
| 19 |
+
}
|
| 20 |
+
]
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dither": 0.0,
|
| 3 |
+
"feature_extractor_type": "Gemma4AudioFeatureExtractor",
|
| 4 |
+
"feature_size": 128,
|
| 5 |
+
"fft_length": 512,
|
| 6 |
+
"fft_overdrive": false,
|
| 7 |
+
"frame_length": 320,
|
| 8 |
+
"hop_length": 160,
|
| 9 |
+
"input_scale_factor": 1.0,
|
| 10 |
+
"max_frequency": 8000.0,
|
| 11 |
+
"mel_floor": 0.001,
|
| 12 |
+
"min_frequency": 0.0,
|
| 13 |
+
"padding_side": "right",
|
| 14 |
+
"padding_value": 0.0,
|
| 15 |
+
"per_bin_mean": null,
|
| 16 |
+
"per_bin_stddev": null,
|
| 17 |
+
"preemphasis": 0.0,
|
| 18 |
+
"preemphasis_htk_flavor": true,
|
| 19 |
+
"return_attention_mask": true,
|
| 20 |
+
"sampling_rate": 16000
|
| 21 |
+
}
|
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 |
+
}
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transformer_task": "feature-extraction",
|
| 3 |
+
"modality_config": {
|
| 4 |
+
"text": {
|
| 5 |
+
"method": "forward",
|
| 6 |
+
"method_output_name": "last_hidden_state"
|
| 7 |
+
},
|
| 8 |
+
"image": {
|
| 9 |
+
"method": "forward",
|
| 10 |
+
"method_output_name": "last_hidden_state"
|
| 11 |
+
},
|
| 12 |
+
"audio": {
|
| 13 |
+
"method": "forward",
|
| 14 |
+
"method_output_name": "last_hidden_state"
|
| 15 |
+
},
|
| 16 |
+
"video": {
|
| 17 |
+
"method": "forward",
|
| 18 |
+
"method_output_name": "last_hidden_state"
|
| 19 |
+
},
|
| 20 |
+
"message": {
|
| 21 |
+
"method": "forward",
|
| 22 |
+
"method_output_name": "last_hidden_state",
|
| 23 |
+
"format": "structured"
|
| 24 |
+
}
|
| 25 |
+
},
|
| 26 |
+
"module_output_name": "token_embeddings"
|
| 27 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4
|
| 3 |
+
size 32170510
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e594c8a90eb08d8bda498ff4747977dc827ae0c3c56b5c0d41a605a22d02ef03
|
| 3 |
+
size 4689013
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_token": "<|audio|>",
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"boa_token": "<|audio>",
|
| 5 |
+
"boi_token": "<|image>",
|
| 6 |
+
"bos_token": "<bos>",
|
| 7 |
+
"eoa_token": "<audio|>",
|
| 8 |
+
"eoc_token": "<channel|>",
|
| 9 |
+
"eoi_token": "<image|>",
|
| 10 |
+
"eos_token": "<eos>",
|
| 11 |
+
"eot_token": "<turn|>",
|
| 12 |
+
"escape_token": "<|\"|>",
|
| 13 |
+
"etc_token": "<tool_call|>",
|
| 14 |
+
"etd_token": "<tool|>",
|
| 15 |
+
"etr_token": "<tool_response|>",
|
| 16 |
+
"extra_special_tokens": [
|
| 17 |
+
"<|video|>"
|
| 18 |
+
],
|
| 19 |
+
"image_token": "<|image|>",
|
| 20 |
+
"is_local": true,
|
| 21 |
+
"local_files_only": false,
|
| 22 |
+
"mask_token": "<mask>",
|
| 23 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 24 |
+
"model_specific_special_tokens": {
|
| 25 |
+
"audio_token": "<|audio|>",
|
| 26 |
+
"boa_token": "<|audio>",
|
| 27 |
+
"boi_token": "<|image>",
|
| 28 |
+
"eoa_token": "<audio|>",
|
| 29 |
+
"eoc_token": "<channel|>",
|
| 30 |
+
"eoi_token": "<image|>",
|
| 31 |
+
"eot_token": "<turn|>",
|
| 32 |
+
"escape_token": "<|\"|>",
|
| 33 |
+
"etc_token": "<tool_call|>",
|
| 34 |
+
"etd_token": "<tool|>",
|
| 35 |
+
"etr_token": "<tool_response|>",
|
| 36 |
+
"image_token": "<|image|>",
|
| 37 |
+
"soc_token": "<|channel>",
|
| 38 |
+
"sot_token": "<|turn>",
|
| 39 |
+
"stc_token": "<|tool_call>",
|
| 40 |
+
"std_token": "<|tool>",
|
| 41 |
+
"str_token": "<|tool_response>",
|
| 42 |
+
"think_token": "<|think|>",
|
| 43 |
+
"video_token": "<|video|>"
|
| 44 |
+
},
|
| 45 |
+
"pad_token": "<pad>",
|
| 46 |
+
"padding_side": "right",
|
| 47 |
+
"processor_class": "EmbeddingGemma2Processor",
|
| 48 |
+
"soc_token": "<|channel>",
|
| 49 |
+
"sot_token": "<|turn>",
|
| 50 |
+
"stc_token": "<|tool_call>",
|
| 51 |
+
"std_token": "<|tool>",
|
| 52 |
+
"str_token": "<|tool_response>",
|
| 53 |
+
"think_token": "<|think|>",
|
| 54 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 55 |
+
"unk_token": "<unk>",
|
| 56 |
+
"video_token": "<|video|>"
|
| 57 |
+
}
|