CoolFace
Modelpublic

Maksim-KOS/embeddinggemma-300m-saturn-planet-v2

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes74downloads
Model Card

SentenceTransformer based on google/embeddinggemma-300m

This is a sentence-transformers model finetuned from google/embeddinggemma-300m. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: google/embeddinggemma-300m <!-- at revision 57c266a740f537b4dc058e1b0cda161fd15afa75 -->
  • —Maximum Sequence Length: 2048 tokens
  • —Output Dimensionality: 768 dimensions
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 2048, 'do_lower_case': False, 'architecture': 'Gemma3TextModel'})
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Dense({'in_features': 768, 'out_features': 3072, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
  (3): Dense({'in_features': 3072, 'out_features': 768, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
  (4): Normalize()
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("Maksim-KOS/embeddinggemma-300m-saturn-planet-v2")
# Run inference
queries = [
    "\u0428\u043a\u0443\u0440\u043a\u0430 \u0432\u043e\u0434\u043e\u0441\u0442\u043e\u0439\u043a\u0430\u044f \u043d\u0430 \u0442\u043a\u0430\u043d\u0435\u0432\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435 P80 80\u043c\u043c \u0440\u0443\u043b\u043e\u043d 20\u043c",
]
documents = [
    'Шкурка шлифовальная водостойкая на тканевой основе 805 мм, 20Н (P80), рулон 20 м',
    'Шкурка шлифовальная водостойкая на тканевой основе 805 мм 25Н (P60) 1 п.м.',
    'Перчатки КЩС тип 2 тонкие',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[ 0.8399,  0.2156, -0.0400]])

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Triplet
MetricValue
cosine_accuracy0.9931

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 124,228 training samples
  • —Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | negative | |:--------|:---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 8 tokens</li><li>mean: 21.2 tokens</li><li>max: 58 tokens</li></ul> | <ul><li>min: 10 tokens</li><li>mean: 26.83 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 27.71 tokens</li><li>max: 51 tokens</li></ul> |
  • —Samples: | anchor | positive | negative | |:--------------------------------------------------------------|:------------------------------------------------------------------------|:-----------------------------------------------------------------------------| | <code>Кабель Камкабель КГтп 2х2,5 220 В (100 м), шт</code> | <code>Кабель КГтп-ХЛ 2х2,5мм2, гибкий, черный (бухта-100п.м.)</code> | <code>Кабель КГтп-ХЛ 2х1,5мм2 TDM гибкий, черный (бухта-100п.м.)</code> | | <code>Клей для плитки Основит Стройбриг С0T АС12 25 кг</code> | <code>Клей для плитки Стройбриг Гранификс АС12 усиленный (25 кг)</code> | <code>Клей для плитки Основит Мастпликс AC121 Т выравнивающий (25 кг)</code> | | <code>линолеум juteks аванта 4м</code> | <code>Линолеум бытовой Juteks Avanta NXT Kortes 4 (4 м)</code> | <code>Линолеум бытовой Juteks Avanta Fort 5 (4 м)</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 13,804 evaluation samples
  • —Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | negative | |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 7 tokens</li><li>mean: 21.33 tokens</li><li>max: 59 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 26.59 tokens</li><li>max: 54 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 27.72 tokens</li><li>max: 55 tokens</li></ul> |
  • —Samples: | anchor | positive | negative | |:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| | <code>Свая винтовая d76х2000 мм, шт</code> | <code>Свая винтовая d=76 мм, L=2000 мм, d винтовой части = 220 мм</code> | <code>Столб заборный винт., L=3000 мм (60х60 мм L=2000 мм, d=51 мм L=1000 мм)</code> | | <code>Нивелир лазерный Condtrol Neo Х200 (1-2-115) с магнитной шайбой, шт</code> | <code>Лазерный нивелир Condtrol NEO X200</code> | <code>Нивелир лазерный Condtrol NEO X2-360</code> | | <code>керамогранит светло-коричневый 594х147 мм</code> | <code>Керамогранит Березакерамика Шеми GP, светло-коричневый, 594х147х9 мм</code> | <code>Керамогранит Керамин Портланд 3, мат., светло-бежевый, 600х600х10 мм</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 32
  • —per_device_eval_batch_size: 32
  • —gradient_accumulation_steps: 8
  • —learning_rate: 1e-05
  • —weight_decay: 0.01
  • —num_train_epochs: 10
  • —lr_scheduler_type: cosine
  • —warmup_ratio: 0.1
  • —load_best_model_at_end: True
  • —optim: adamw_torch
  • —batch_sampler: no_duplicates
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: steps
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 32
  • —per_device_eval_batch_size: 32
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 8
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 1e-05
  • —weight_decay: 0.01
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 10
  • —max_steps: -1
  • —lr_scheduler_type: cosine
  • —lr_scheduler_kwargs: None
  • —warmup_ratio: 0.1
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —save_safetensors: True
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —no_cuda: False
  • —use_cpu: False
  • —use_mps_device: False
  • —seed: 42
  • —data_seed: None
  • —jit_mode_eval: False
  • —bf16: False
  • —fp16: False
  • —fp16_opt_level: O1
  • —half_precision_backend: auto
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: 0
  • —ddp_backend: None
  • —tpu_num_cores: None
  • —tpu_metrics_debug: False
  • —debug: []
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: None
  • —past_index: -1
  • —disable_tqdm: False
  • —remove_unused_columns: True
  • —label_names: None
  • —load_best_model_at_end: True
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_min_num_params: 0
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamw_torch
  • —optim_args: None
  • —adafactor: False
  • —group_by_length: False
  • —length_column_name: length
  • —project: huggingface
  • —trackio_space_id: trackio
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —skip_memory_metrics: True
  • —use_legacy_prediction_loop: False
  • —push_to_hub: False
  • —resume_from_checkpoint: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: None
  • —hub_always_push: False
  • —hub_revision: None
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —include_for_metrics: []
  • —eval_do_concat_batches: True
  • —fp16_backend: auto
  • —push_to_hub_model_id: None
  • —push_to_hub_organization: None
  • —mp_parameters:
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —torchdynamo: None
  • —ray_scope: last
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —include_tokens_per_second: False
  • —include_num_input_tokens_seen: no
  • —neftune_noise_alpha: None
  • —optim_target_modules: None
  • —batch_eval_metrics: False
  • —eval_on_start: False
  • —use_liger_kernel: False
  • —liger_kernel_config: None
  • —eval_use_gather_object: False
  • —average_tokens_across_devices: True
  • —prompts: None
  • —batch_sampler: no_duplicates
  • —multi_dataset_batch_sampler: proportional
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

EpochStepTraining LossValidation Losshard-neg-eval_cosine_accuracy
0.1030500.2049--
0.20601000.09090.08620.9690
0.30901500.0768--
0.41212000.06520.06260.9769
0.51512500.0597--
0.61813000.05920.05640.9793
0.72113500.0572--
0.82414000.04840.04970.9814
0.92714500.0492--
1.02885000.04440.05030.9811
1.13195500.039--
1.23496000.03990.04480.9830
1.33796500.0397--
1.44097000.03510.04050.9851
1.54397500.0368--
1.64698000.03890.03750.9851
1.74998500.0353--
1.85299000.03660.03540.9859
1.95609500.0314--
2.057710000.02640.03450.9865
2.160710500.0234--
2.263711000.02450.03430.9869
2.366711500.0229--
2.469712000.02350.03350.9875
2.572812500.0226--
2.675813000.02490.02930.9888
2.778813500.0224--
2.881814000.0230.02780.9904
2.984814500.0233--
3.086515000.01560.02750.9896
3.189515500.0145--
3.292616000.01420.02690.9896
3.395616500.015--
3.498617000.0170.02580.9897
3.601617500.0152--
3.704618000.01480.02460.9905
3.807618500.0149--
3.910619000.01660.02510.9902
4.012419500.0173--
4.115420000.01020.02380.9907
4.218420500.0092--
4.321421000.01130.02210.9920
4.424421500.0082--
4.527422000.00910.02210.9921
4.630422500.0107--
4.733523000.01110.02080.9928
4.836523500.0086--
4.939524000.01030.02020.9921
5.041224500.0076--
5.144225000.00660.01930.9933
5.247225500.0068--
5.350226000.0060.01980.9932
5.453326500.0064--
5.556327000.00570.01900.9931
5.659327500.0057--
5.762328000.00610.01840.9931
  • —The bold row denotes the saved checkpoint.

Framework Versions

  • —Python: 3.12.3
  • —Sentence Transformers: 5.2.0
  • —Transformers: 4.57.6
  • —PyTorch: 2.9.1+cu128
  • —Accelerate: 1.12.0
  • —Datasets: 4.5.0
  • —Tokenizers: 0.22.2

Citation

BibTeX

Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->