CoolFace
Modelpublic

philipp-zettl/gte-micro-v4-mtg-v2

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes14downloads
Model Card

SentenceTransformer based on Mihaiii/gte-micro-v4

This is a sentence-transformers model finetuned from Mihaiii/gte-micro-v4. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: Mihaiii/gte-micro-v4 <!-- at revision 78e1a4b348f8524c3ab2e3e3475788f5adb8c98f -->
  • —Maximum Sequence Length: 256 tokens
  • —Output Dimensionality: 384 dimensions
  • —Similarity Function: Cosine Similarity
  • —Supported Modality: Text <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
  (1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'mean', 'include_prompt': True})
)

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("philipp-zettl/gte-micro-v4-mtg-v2")
# Run inference
sentences = [
    'creature — drake',
    'Title: Fighting Drake\nCost: {2}{U}{U}\nColors: U\nType: Creature — Drake\nDesc: Flying',
    "Title: Big Game Hunter\nCost: {1}{B}{B}\nColors: B\nType: Creature — Human Rebel Assassin\nDesc: When this creature enters, destroy target creature with power 4 or greater. It can't be regenerated.\nMadness {B} (If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.)",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000,  0.6089,  0.0016],
#         [ 0.6089,  1.0000, -0.1129],
#         [ 0.0016, -0.1129,  1.0000]])

<!--

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. -->

<!--

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: 2,132,917 training samples
  • —Columns: <code>sentence0</code> and <code>sentence1</code>
  • —Approximate statistics based on the first 100 samples: | | sentence0 | sentence1 | |:---------|:---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------| | type | string | string | | modality | text | text | | details | <ul><li>min: 3 tokens</li><li>mean: 10.1 tokens</li><li>max: 41 tokens</li></ul> | <ul><li>min: 24 tokens</li><li>mean: 62.76 tokens</li><li>max: 146 tokens</li></ul> |
  • —Samples: | sentence0 | sentence1 | |:------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>magnifying glass</code> | <code>Title: Magnifying Glass<br>Cost: {3}<br>Type: Artifact<br>Desc: {T}: Add {C}.<br>{4}, {T}: Investigate. (Create a Clue token. It's an artifact with "{2}, Sacrifice this token: Draw a card.")</code> | | <code>sorcery</code> | <code>Title: Graveyard Shift<br>Cost: {4}{B}<br>Colors: B<br>Type: Sorcery<br>Desc: This spell has flash as long as there are five or more mana values among cards in your graveyard.<br>Return target creature card from your graveyard to the battlefield.</code> | | <code>beacon of unrest</code> | <code>Title: Beacon of Unrest<br>Cost: {3}{B}{B}<br>Colors: B<br>Type: Sorcery<br>Desc: Put target artifact or creature card from a graveyard onto the battlefield under your control. Shuffle Beacon of Unrest into its owner's library.</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false,
      "directions": [
          "query_to_doc"
      ],
      "partition_mode": "joint",
      "hardness_mode": null,
      "hardness_strength": 0.0
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 96
  • —fp16: True
  • —per_device_eval_batch_size: 96
  • —multi_dataset_batch_sampler: round_robin
All Hyperparameters

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

  • —per_device_train_batch_size: 96
  • —num_train_epochs: 3
  • —max_steps: -1
  • —learning_rate: 5e-05
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: None
  • —warmup_steps: 0
  • —optim: adamwtorchfused
  • —optim_args: None
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —optim_target_modules: None
  • —gradient_accumulation_steps: 1
  • —average_tokens_across_devices: True
  • —max_grad_norm: 1
  • —label_smoothing_factor: 0.0
  • —bf16: False
  • —fp16: True
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —use_liger_kernel: False
  • —liger_kernel_config: None
  • —use_cache: False
  • —neftune_noise_alpha: None
  • —torch_empty_cache_steps: None
  • —auto_find_batch_size: False
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —include_num_input_tokens_seen: no
  • —log_level: passive
  • —log_level_replica: warning
  • —disable_tqdm: False
  • —project: huggingface
  • —trackio_space_id: None
  • —trackio_bucket_id: None
  • —trackio_static_space_id: None
  • —per_device_eval_batch_size: 96
  • —prediction_loss_only: True
  • —eval_on_start: False
  • —eval_do_concat_batches: True
  • —eval_use_gather_object: False
  • —eval_accumulation_steps: None
  • —include_for_metrics: []
  • —batch_eval_metrics: False
  • —save_only_model: False
  • —save_on_each_node: False
  • —enable_jit_checkpoint: False
  • —push_to_hub: False
  • —hub_private_repo: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_always_push: False
  • —hub_revision: None
  • —load_best_model_at_end: False
  • —ignore_data_skip: False
  • —restore_callback_states_from_checkpoint: False
  • —full_determinism: False
  • —seed: 42
  • —data_seed: None
  • —use_cpu: False
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —dataloader_prefetch_factor: None
  • —remove_unused_columns: True
  • —label_names: None
  • —train_sampling_strategy: random
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —ddp_static_graph: None
  • —ddp_backend: None
  • —ddp_timeout: 1800
  • —fsdp: None
  • —fsdp_config: None
  • —deepspeed: None
  • —debug: []
  • —skip_memory_metrics: True
  • —do_predict: False
  • —resume_from_checkpoint: None
  • —warmup_ratio: None
  • —local_rank: -1
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: round_robin
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

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

EpochStepTraining Loss
0.02255001.8730
0.045010000.5353
0.067515000.4567
0.090020000.4285
0.112525000.4066
0.135030000.3939
0.157535000.3833
0.180040000.3718
0.202545000.3707
0.225050000.3703
0.247555000.3630
0.270160000.3537
0.292665000.3575
0.315170000.3548
0.337675000.3565
0.360180000.3476
0.382685000.3422
0.405190000.3423
0.427695000.3414
0.4501100000.3410
0.4726105000.3480
0.4951110000.3406
0.5176115000.3293
0.5401120000.3354
0.5626125000.3337
0.5851130000.3371
0.6076135000.3376
0.6301140000.3347
0.6526145000.3297
0.6751150000.3326
0.6976155000.3297
0.7201160000.3213
0.7426165000.3270
0.7651170000.3291
0.7876175000.3291
0.8102180000.3235
0.8327185000.3293
0.8552190000.3212
0.8777195000.3261
0.9002200000.3191
0.9227205000.3176
0.9452210000.3145
0.9677215000.3267
0.9902220000.3197
1.0127225000.3160
1.0352230000.3230
1.0577235000.3182
1.0802240000.3221
1.1027245000.3169
1.1252250000.3125
1.1477255000.3135
1.1702260000.3149
1.1927265000.3182
1.2152270000.3246
1.2377275000.3161
1.2602280000.3173
1.2827285000.3137
1.3052290000.3147
1.3278295000.3110
1.3503300000.3129
1.3728305000.3111
1.3953310000.3132
1.4178315000.3176
1.4403320000.3092
1.4628325000.3177
1.4853330000.3031
1.5078335000.3126
1.5303340000.3144
1.5528345000.3061
1.5753350000.3120
1.5978355000.3083
1.6203360000.3087
1.6428365000.3131
1.6653370000.3108
1.6878375000.3131
1.7103380000.3092
1.7328385000.3099
1.7553390000.3104
1.7778395000.3049
1.8003400000.3061
1.8228405000.3105
1.8454410000.3031
1.8679415000.3008
1.8904420000.3108
1.9129425000.3071
1.9354430000.3067
1.9579435000.3077
1.9804440000.3094
2.0029445000.3031
2.0254450000.3045
2.0479455000.3056
2.0704460000.3075
2.0929465000.3054
2.1154470000.2982
2.1379475000.3003
2.1604480000.3077
2.1829485000.3012
2.2054490000.3060
2.2279495000.2995
2.2504500000.3060
2.2729505000.3098
2.2954510000.3002
2.3179515000.3004
2.3404520000.3095
2.3629525000.3028
2.3855530000.3040
2.4080535000.3056
2.4305540000.3066
2.4530545000.3013
2.4755550000.3074
2.4980555000.3054
2.5205560000.3053
2.5430565000.3001
2.5655570000.2987
2.5880575000.3104
2.6105580000.3044
2.6330585000.3015
2.6555590000.3076
2.6780595000.3012
2.7005600000.3022
2.7230605000.3084
2.7455610000.3004
2.7680615000.3056
2.7905620000.3057
2.8130625000.2993
2.8355630000.3010
2.8580635000.3019
2.8805640000.2993
2.9031645000.3040
2.9256650000.3003
2.9481655000.3000
2.9706660000.2982
2.9931665000.3003

</details>

Training Time

  • —Training: 1.7 hours

Framework Versions

  • —Python: 3.13.11
  • —Sentence Transformers: 5.6.0
  • —Transformers: 5.14.1
  • —PyTorch: 2.13.0+cu130
  • —Accelerate: 1.14.0
  • —Datasets: 5.0.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{oord2019representationlearningcontrastivepredictive,
      title={Representation Learning with Contrastive Predictive Coding},
      author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
      year={2019},
      eprint={1807.03748},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1807.03748},
}

<!--

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. -->