Sentence Similarity
sentence-transformers
Safetensors
Nepali (macrolanguage)
gemma3_text
trimmed
text-embeddings-inference
Instructions to use alphaedge-ai/embeddinggemma-nep-16384 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use alphaedge-ai/embeddinggemma-nep-16384 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("alphaedge-ai/embeddinggemma-nep-16384") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Trimmed EmbeddingGemma 300M for Nepali
Browse files- README.md +49 -0
- config.json +68 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +13 -0
README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: fill-mask
|
| 3 |
+
language: nep
|
| 4 |
+
tags:
|
| 5 |
+
- trimmed
|
| 6 |
+
library_name: transformers
|
| 7 |
+
base_model: google/embeddinggemma-300m
|
| 8 |
+
base_model_relation: quantized
|
| 9 |
+
datasets:
|
| 10 |
+
- Lumberjackk/fineweb-2-trimming
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# embeddinggemma-nep-16384
|
| 14 |
+
|
| 15 |
+
This model is a 62.3% smaller version of [google/embeddinggemma-300m](https://huggingface.co/google/embeddinggemma-300m)
|
| 16 |
+
optimized for Nepali language via vocabulary trimming mined on [Lumberjackk/fineweb-2-trimming](https://huggingface.co/datasets/Lumberjackk/fineweb-2-trimming).
|
| 17 |
+
|
| 18 |
+
## Model Statistics
|
| 19 |
+
- **Original vocabulary size:** 262,144 tokens
|
| 20 |
+
- **Trimmed vocabulary size:** 16,384 tokens
|
| 21 |
+
- **Vocabulary reduction:** 93.7%
|
| 22 |
+
- **Original model size:** 302,863,104 parameters
|
| 23 |
+
- **Trimmed model size:** 114,119,424 parameters
|
| 24 |
+
- **Size reduction:** 62.3%
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
## Usage
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
from sentence_transformers import SentenceTransformer
|
| 31 |
+
|
| 32 |
+
# Download from the 🤗 Hub
|
| 33 |
+
model = SentenceTransformer("embeddinggemma-nep-16384")
|
| 34 |
+
|
| 35 |
+
# Run inference with queries and documents
|
| 36 |
+
query = "My query"
|
| 37 |
+
documents = [
|
| 38 |
+
"Chunk 1",
|
| 39 |
+
"Chunk 2",
|
| 40 |
+
"Chunk 3",
|
| 41 |
+
]
|
| 42 |
+
query_embeddings = model.encode_query(query)
|
| 43 |
+
document_embeddings = model.encode_document(documents)
|
| 44 |
+
print(query_embeddings.shape, document_embeddings.shape)
|
| 45 |
+
|
| 46 |
+
# Compute similarities to determine a ranking
|
| 47 |
+
similarities = model.similarity(query_embeddings, document_embeddings)
|
| 48 |
+
print(similarities)
|
| 49 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_sliding_window_pattern": 6,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Gemma3TextModel"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"attn_logit_softcapping": null,
|
| 9 |
+
"bos_token_id": 2,
|
| 10 |
+
"dtype": "float32",
|
| 11 |
+
"eos_token_id": 1,
|
| 12 |
+
"final_logit_softcapping": null,
|
| 13 |
+
"head_dim": 256,
|
| 14 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 15 |
+
"hidden_size": 768,
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"intermediate_size": 1152,
|
| 18 |
+
"layer_types": [
|
| 19 |
+
"sliding_attention",
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"sliding_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"sliding_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"full_attention"
|
| 43 |
+
],
|
| 44 |
+
"max_position_embeddings": 2048,
|
| 45 |
+
"model_type": "gemma3_text",
|
| 46 |
+
"num_attention_heads": 3,
|
| 47 |
+
"num_hidden_layers": 24,
|
| 48 |
+
"num_key_value_heads": 1,
|
| 49 |
+
"pad_token_id": 0,
|
| 50 |
+
"query_pre_attn_scalar": 256,
|
| 51 |
+
"rms_norm_eps": 1e-06,
|
| 52 |
+
"rope_parameters": {
|
| 53 |
+
"full_attention": {
|
| 54 |
+
"rope_theta": 1000000.0,
|
| 55 |
+
"rope_type": "default"
|
| 56 |
+
},
|
| 57 |
+
"sliding_attention": {
|
| 58 |
+
"rope_theta": 10000.0,
|
| 59 |
+
"rope_type": "default"
|
| 60 |
+
}
|
| 61 |
+
},
|
| 62 |
+
"sliding_window": 257,
|
| 63 |
+
"tie_word_embeddings": true,
|
| 64 |
+
"transformers_version": "5.3.0.dev0",
|
| 65 |
+
"use_bidirectional_attention": true,
|
| 66 |
+
"use_cache": true,
|
| 67 |
+
"vocab_size": 16384
|
| 68 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91e201bc2fbac4bd6146685391aa99db876f8e378da6609a4896fe163efad714
|
| 3 |
+
size 456510944
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<bos>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<eos>",
|
| 6 |
+
"is_local": true,
|
| 7 |
+
"mask_token": "<mask>",
|
| 8 |
+
"model_max_length": 2048,
|
| 9 |
+
"pad_token": "<pad>",
|
| 10 |
+
"padding_side": "right",
|
| 11 |
+
"tokenizer_class": "TokenizersBackend",
|
| 12 |
+
"unk_token": "<unk>"
|
| 13 |
+
}
|