CoolFace
Modelpublic

philipp-zettl/MiniLM-L3-H384-uncased-mtg-v2

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

SentenceTransformer based on nreimers/MiniLM-L3-H384-uncased

This is a sentence-transformers model finetuned from nreimers/MiniLM-L3-H384-uncased. 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: nreimers/MiniLM-L3-H384-uncased <!-- at revision 1857068a44253cf9ab23aefdf562335601cffcda -->
  • —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/MiniLM-L3-H384-uncased-mtg-v2")
# Run inference
sentences = [
    'vigilance\nwhenever this creature enters or attacks, you may return target permanent card with mana value 3 or less from your graveyard to the battlefield',
    'Title: Sun Titan\nCost: {4}{W}{W}\nColors: W\nType: Creature — Giant\nDesc: Vigilance\nWhenever this creature enters or attacks, you may return target permanent card with mana value 3 or less from your graveyard to the battlefield.',
    'Title: Baloth Pup\nCost: {1}{G}\nColors: G\nType: Creature — Beast\nDesc: This creature has trample as long as it has a +1/+1 counter on it.',
]
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.6280, 0.0774],
#         [0.6280, 1.0000, 0.2148],
#         [0.0774, 0.2148, 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: 12.04 tokens</li><li>max: 40 tokens</li></ul> | <ul><li>min: 25 tokens</li><li>mean: 65.11 tokens</li><li>max: 128 tokens</li></ul> |
  • —Samples: | sentence0 | sentence1 | |:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>mind rot</code> | <code>Title: Mind Rot<br>Cost: {2}{B}<br>Colors: B<br>Type: Sorcery<br>Desc: Target player discards two cards.</code> | | <code>that creature doesn't untap during its controller's next untap step</code> | <code>Title: Watertrap Weaver<br>Cost: {2}{U}<br>Colors: U<br>Type: Creature — Merfolk Wizard<br>Desc: When this creature enters, tap target creature an opponent controls. That creature doesn't untap during its controller's next untap step.</code> | | <code>kardur, doomscourge</code> | <code>Title: Kardur, Doomscourge<br>Cost: {2}{B}{R}<br>Colors: B, R<br>Type: Legendary Creature — Demon Berserker<br>Desc: When Kardur enters, until your next turn, creatures your opponents control attack each combat if able and attack a player other than you if able.<br>Whenever an attacking creature dies, each opponent loses 1 life and you gain 1 life.</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.02255003.3970
0.045010001.2978
0.067515000.9287
0.090020000.7950
0.112525000.7100
0.135030000.6584
0.157535000.6290
0.180040000.5884
0.202545000.5633
0.225050000.5537
0.247555000.5350
0.270160000.5262
0.292665000.5068
0.315170000.4917
0.337675000.4840
0.360180000.4758
0.382685000.4650
0.405190000.4604
0.427695000.4589
0.4501100000.4412
0.4726105000.4391
0.4951110000.4352
0.5176115000.4323
0.5401120000.4235
0.5626125000.4158
0.5851130000.4161
0.6076135000.4205
0.6301140000.4180
0.6526145000.4073
0.6751150000.4053
0.6976155000.4019
0.7201160000.4002
0.7426165000.3985
0.7651170000.3952
0.7876175000.3942
0.8102180000.3847
0.8327185000.3846
0.8552190000.3853
0.8777195000.3868
0.9002200000.3852
0.9227205000.3781
0.9452210000.3725
0.9677215000.3784
0.9902220000.3751
1.0127225000.3685
1.0352230000.3663
1.0577235000.3722
1.0802240000.3667
1.1027245000.3656
1.1252250000.3646
1.1477255000.3600
1.1702260000.3618
1.1927265000.3625
1.2152270000.3540
1.2377275000.3662
1.2602280000.3581
1.2827285000.3521
1.3052290000.3541
1.3278295000.3506
1.3503300000.3574
1.3728305000.3530
1.3953310000.3551
1.4178315000.3579
1.4403320000.3555
1.4628325000.3572
1.4853330000.3545
1.5078335000.3433
1.5303340000.3497
1.5528345000.3511
1.5753350000.3515
1.5978355000.3454
1.6203360000.3507
1.6428365000.3486
1.6653370000.3493
1.6878375000.3487
1.7103380000.3430
1.7328385000.3447
1.7553390000.3483
1.7778395000.3385
1.8003400000.3443
1.8228405000.3424
1.8454410000.3448
1.8679415000.3402
1.8904420000.3425
1.9129425000.3452
1.9354430000.3397
1.9579435000.3353
1.9804440000.3393
2.0029445000.3441
2.0254450000.3375
2.0479455000.3378
2.0704460000.3339
2.0929465000.3408
2.1154470000.3330
2.1379475000.3343
2.1604480000.3365
2.1829485000.3363
2.2054490000.3311
2.2279495000.3377
2.2504500000.3314
2.2729505000.3399
2.2954510000.3336
2.3179515000.3333
2.3404520000.3322
2.3629525000.3322
2.3855530000.3282
2.4080535000.3364
2.4305540000.3303
2.4530545000.3323
2.4755550000.3294
2.4980555000.3315
2.5205560000.3315
2.5430565000.3346
2.5655570000.3374
2.5880575000.3290
2.6105580000.3338
2.6330585000.3316
2.6555590000.3314
2.6780595000.3334
2.7005600000.3305
2.7230605000.3311
2.7455610000.3313
2.7680615000.3303
2.7905620000.3280
2.8130625000.3303
2.8355630000.3282
2.8580635000.3374
2.8805640000.3313
2.9031645000.3330
2.9256650000.3331
2.9481655000.3240
2.9706660000.3260
2.9931665000.3298

</details>

Training Time

  • —Training: 1.3 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. -->