CoolFace
Modelpublic

dhammanana/harrier-tipitaka-v1

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes65downloads
Model Card

SentenceTransformer based on microsoft/harrier-oss-v1-270m

This is a sentence-transformers model finetuned from microsoft/harrier-oss-v1-270m. It maps sentences & paragraphs to a 640-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: microsoft/harrier-oss-v1-270m <!-- at revision 31de22b673913c7d658c0f03f792d77c2dcf8ebd -->
  • —Maximum Sequence Length: 128 tokens
  • —Output Dimensionality: 640 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': 'Gemma3TextModel'})
  (1): Pooling({'embedding_dimension': 640, 'pooling_mode': 'lasttoken', 'include_prompt': True})
  (2): 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("sentence_transformers_model_id")
# Run inference
sentences = [
    'Instruct: Represent this Buddhist passage for semantic retrieval.\nQuery: Bhagavā taṃ paṭiggahetvā ānandattheraṃ āṇāpesi – ‘‘ imaṃ phalaṃ madditvā pānaṃ dehī ’’ ti. Thero tathā akāsi. Bhagavā ambarasaṃ pivitvā ambaṭṭhiṃ uyyānapālassa datvā ‘‘ imaṃ ropehī ’’ ti āha. So vālukaṃ viyūhitvā taṃ ropesi, ānandatthero kuṇḍikāya udakaṃ āsiñci.',
    'The Blessed One accepted it and instructed Venerable Ānanda: “Crush this fruit and give it as a drink.” The Elder did so. The Blessed One, having drunk the mango juice, gave the mango seed to the gardener and said, “Plant this.” He dug up the sand and planted it, and Venerable Ānanda poured water from a vessel.',
    '“The foremost of my disciples, monks, who are very learned. Who are mindful. Who are clear-headed. Who are resolute. Who are attendants, is Ānanda” –',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 640]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.8314, 0.1940],
#         [0.8314, 1.0000, 0.2902],
#         [0.1940, 0.2902, 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: 744,489 training samples
  • —Columns: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 22 tokens</li><li>mean: 90.93 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 9 tokens</li><li>mean: 55.09 tokens</li><li>max: 128 tokens</li></ul> |
  • —Samples: | anchor | positive | |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Instruct: Represent this Buddhist passage for semantic retrieval.<br>Query: Namo tassa bhagavato arahato sammāsambuddhassa</code> | <code>Homage to the Blessed One, the Perfected One, the Fully Self-Awakened Buddha</code> | | <code>Instruct: Represent this Buddhist passage for semantic retrieval.<br>Query: 1. Evaṃ me sutaṃ – ekaṃ samayaṃ bhagavā sāvatthiyaṃ viharati jetavane anāthapiṇḍikassa ārāme. Tatra kho bhagavā bhikkhū āmantesi – ‘‘ bhikkhavo ’’ ti. ‘‘ Bhadante ’’ ti te bhikkhū bhagavato paccassosuṃ. Bhagavā etadavoca –</code> | <code>Thus have I heard — on one occasion the Blessed One was dwelling at Sāvatthī in Jeta's Grove, in Anāthapiṇḍika’s Park. There the Blessed One addressed the monks: “Monks!” “Venerable sir,” those monks replied to the Blessed One. The Blessed One said:</code> | | <code>Instruct: Represent this Buddhist passage for semantic retrieval.<br>Query: 2.‘‘ Nāhaṃ, bhikkhave, aññaṃ ekasaddampi samanupassāmi yaṃ evaṃ purisassa cittaṃ pariyādāya tiṭṭhati yathayidaṃ, bhikkhave, itthisaddo. Itthisaddo, bhikkhave, purisassa cittaṃ pariyādāya tiṭṭhatī ’’ ti. Dutiyaṃ.</code> | <code>“Monks, I do not see a single sound that invades his mind and remains in a person as much as the sound of a woman. The sound of a woman, monks, overpowers a man’s mind.” The second.</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
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 15,180 evaluation samples
  • —Columns: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 21 tokens</li><li>mean: 82.69 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 58.92 tokens</li><li>max: 128 tokens</li></ul> |
  • —Samples: | anchor | positive | |:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Instruct: Represent this Buddhist passage for semantic retrieval.<br>Query: ‘‘ Nāhaṃ, bhikkhave, aññaṃ ekarūpampi samanupassāmi yaṃ evaṃ purisassa cittaṃ pariyādāya tiṭṭhati yathayidaṃ, bhikkhave, itthirūpaṃ. Itthirūpaṃ, bhikkhave, purisassa cittaṃ pariyādāya tiṭṭhatī ’’ ti. Paṭhamaṃ.</code> | <code>“Monks, I do not see a single sight that invades his mind and remains in a person as much as the sight of a woman. The sight of a woman, monks, overpowers a man’s mind.” The first.</code> | | <code>Instruct: Represent this Buddhist passage for semantic retrieval.<br>Query: Paṇihitaacchavaggo pañcamo.</code> | <code>The Chapter on the Directed and Clear is the fifth.</code> | | <code>Instruct: Represent this Buddhist passage for semantic retrieval.<br>Query: 8. Kalyāṇamittādivaggo</code> | <code>8. Chapter on Good Friendship</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: 16
  • —gradient_accumulation_steps: 2
  • —learning_rate: 2e-05
  • —num_train_epochs: 1
  • —lr_scheduler_type: cosine
  • —warmup_steps: 0.05
  • —fp16: True
  • —remove_unused_columns: False
  • —load_best_model_at_end: True
  • —batch_sampler: no_duplicates
All Hyperparameters

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

  • —do_predict: False
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 16
  • —per_device_eval_batch_size: 8
  • —gradient_accumulation_steps: 2
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 2e-05
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 1
  • —max_steps: -1
  • —lr_scheduler_type: cosine
  • —lr_scheduler_kwargs: None
  • —warmup_ratio: None
  • —warmup_steps: 0.05
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —enable_jit_checkpoint: False
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —use_cpu: False
  • —seed: 42
  • —data_seed: None
  • —bf16: False
  • —fp16: True
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: -1
  • —ddp_backend: None
  • —debug: []
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: None
  • —disable_tqdm: False
  • —remove_unused_columns: False
  • —label_names: None
  • —load_best_model_at_end: True
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —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: adamwtorchfused
  • —optim_args: None
  • —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
  • —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_for_metrics: []
  • —eval_do_concat_batches: True
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —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
  • —use_cache: False
  • —prompts: None
  • —batch_sampler: no_duplicates
  • —multi_dataset_batch_sampler: proportional
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

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

EpochStepTraining LossValidation Loss
0.000012.4117-
0.0021502.2977-
0.00431001.4074-
0.00641500.9612-
0.00862000.6430-
0.01072500.4462-
0.01293000.3157-
0.01503500.2660-
0.01724000.2222-
0.01934500.1691-
0.02155000.1565-
0.02365500.1109-
0.02586000.1512-
0.02796500.1317-
0.03017000.1211-
0.03227500.0998-
0.03448000.0884-
0.03658500.0988-
0.03879000.0813-
0.04089500.0744-
0.043010000.0733-
0.045110500.0689-
0.047311000.0577-
0.049411500.0637-
0.051612000.0645-
0.053712500.0491-
0.055913000.0614-
0.058013500.0512-
0.060214000.0452-
0.062314500.0577-
0.064515000.0518-
0.066615500.0366-
0.068816000.0529-
0.070916500.0412-
0.073117000.0313-
0.075217500.0397-
0.077418000.0361-
0.079518500.0428-
0.081719000.0423-
0.083819500.0288-
0.086020000.04900.0196
0.088120500.0379-
0.090321000.0309-
0.092421500.0347-
0.094622000.0327-
0.096722500.0442-
0.098923000.0244-
0.101023500.0337-
0.103224000.0308-
0.105324500.0271-
0.107525000.0342-
0.109625500.0344-
0.111826000.0285-
0.113926500.0334-
0.116127000.0359-
0.118227500.0309-
0.120328000.0455-
0.122528500.0301-
0.124629000.0229-
0.126829500.0236-
0.128930000.0327-
0.131130500.0148-
0.133231000.0189-
0.135431500.0213-
0.137532000.0246-
0.139732500.0230-
0.141833000.0246-
0.144033500.0204-
0.146134000.0207-
0.148334500.0339-
0.150435000.0202-
0.152635500.0268-
0.154736000.0252-
0.156936500.0225-
0.159037000.0279-
0.161237500.0233-
0.163338000.0204-
0.165538500.0212-
0.167639000.0256-
0.169839500.0211-
0.171940000.02090.0132
0.174140500.0245-
0.176241000.0176-
0.178441500.0184-
0.180542000.0293-
0.182742500.0256-
0.184843000.0185-
0.187043500.0115-
0.189144000.0199-
0.191344500.0145-
0.193445000.0158-
0.195645500.0238-
0.197746000.0267-
0.199946500.0222-
0.202047000.0166-
0.204247500.0175-
0.206348000.0168-
0.208548500.0188-
0.210649000.0182-
0.212849500.0108-
0.214950000.0202-
0.217150500.0128-
0.219251000.0148-
0.221451500.0182-
0.223552000.0124-
0.225752500.0137-
0.227853000.0099-
0.230053500.0203-
0.232154000.0128-
0.234354500.0168-
0.236455000.0185-
0.238655500.0143-
0.240756000.0148-
0.242856500.0290-
0.245057000.0133-
0.247157500.0146-
0.249358000.0192-
0.251458500.0229-
0.253659000.0234-
0.255759500.0114-
0.257960000.00980.0111
0.260060500.0163-
0.262261000.0119-
0.264361500.0187-
0.266562000.0184-
0.268662500.0129-
0.270863000.0131-
0.272963500.0129-
0.275164000.0138-
0.277264500.0122-
0.279465000.0198-
0.281565500.0231-
0.283766000.0150-
0.285866500.0173-
0.288067000.0156-
0.290167500.0212-
0.292368000.0159-
0.294468500.0250-
0.296669000.0144-
0.298769500.0181-
0.300970000.0123-
0.303070500.0222-
0.305271000.0155-
0.307371500.0263-
0.309572000.0216-
0.311672500.0143-
0.313873000.0092-
0.315973500.0070-
0.318174000.0203-
0.320274500.0174-
0.322475000.0262-
0.324575500.0239-
0.326776000.0126-
0.328876500.0132-
0.331077000.0145-
0.333177500.0170-
0.335378000.0125-
0.337478500.0124-
0.339679000.0205-
0.341779500.0108-
0.343980000.01560.0099
0.346080500.0151-
0.348281000.0188-
0.350381500.0059-
0.352582000.0152-
0.354682500.0202-
0.356883000.0131-
0.358983500.0145-
0.361084000.0135-
0.363284500.0147-
0.365385000.0080-
0.367585500.0118-
0.369686000.0064-
0.371886500.0204-
0.373987000.0101-
0.376187500.0125-
0.378288000.0129-
0.380488500.0062-
0.382589000.0120-
0.384789500.0112-
0.386890000.0131-
0.389090500.0166-
0.391191000.0114-
0.393391500.0157-
0.395492000.0133-
0.397692500.0145-
0.399793000.0042-
0.401993500.0142-
0.404094000.0138-
0.406294500.0214-
0.408395000.0095-
0.410595500.0067-
0.412696000.0094-
0.414896500.0063-
0.416997000.0120-
0.419197500.0116-
0.421298000.0105-
0.423498500.0222-
0.425599000.0142-
0.427799500.0121-
0.4298100000.00910.0080
0.4320100500.0173-
0.4341101000.0098-
0.4363101500.0195-
0.4384102000.0117-
0.4406102500.0091-
0.4427103000.0146-
0.4449103500.0143-
0.4470104000.0132-
0.4492104500.0125-
0.4513105000.0116-
0.4535105500.0106-
0.4556106000.0099-
0.4578106500.0118-
0.4599107000.0051-
0.4621107500.0079-
0.4642108000.0086-
0.4664108500.0094-
0.4685109000.0065-
0.4707109500.0182-
0.4728110000.0160-
0.4750110500.0094-
0.4771111000.0129-
0.4793111500.0119-
0.4814112000.0183-
0.4835112500.0208-
0.4857113000.0125-
0.4878113500.0063-
0.4900114000.0106-
0.4921114500.0136-
0.4943115000.0086-
0.4964115500.0085-
0.4986116000.0115-
0.5007116500.0137-
0.5029117000.0141-
0.5050117500.0064-
0.5072118000.0123-
0.5093118500.0094-
0.5115119000.0090-
0.5136119500.0053-
0.5158120000.00860.0076
0.5179120500.0093-
0.5201121000.0063-
0.5222121500.0121-
0.5244122000.0103-
0.5265122500.0066-
0.5287123000.0112-
0.5308123500.0127-
0.5330124000.0161-
0.5351124500.0071-
0.5373125000.0096-
0.5394125500.0088-
0.5416126000.0095-
0.5437126500.0075-
0.5459127000.0113-
0.5480127500.0121-
0.5502128000.0059-
0.5523128500.0099-
0.5545129000.0064-
0.5566129500.0094-
0.5588130000.0108-
0.5609130500.0074-
0.5631131000.0038-
0.5652131500.0043-
0.5674132000.0082-
0.5695132500.0112-
0.5717133000.0178-
0.5738133500.0073-
0.5760134000.0059-
0.5781134500.0042-
0.5803135000.0121-
0.5824135500.0093-
0.5846136000.0087-
0.5867136500.0169-
0.5889137000.0064-
0.5910137500.0047-
0.5932138000.0099-
0.5953138500.0086-
0.5975139000.0173-
0.5996139500.0141-
0.6017140000.00710.0070
0.6039140500.0066-
0.6060141000.0069-
0.6082141500.0143-
0.6103142000.0084-
0.6125142500.0119-
0.6146143000.0142-
0.6168143500.0067-
0.6189144000.0186-
0.6211144500.0164-
0.6232145000.0060-
0.6254145500.0175-
0.6275146000.0060-
0.6297146500.0137-
0.6318147000.0161-
0.6340147500.0064-
0.6361148000.0067-
0.6383148500.0153-
0.6404149000.0056-
0.6426149500.0149-
0.6447150000.0052-
0.6469150500.0153-
0.6490151000.0069-
0.6512151500.0155-
0.6533152000.0060-
0.6555152500.0079-
0.6576153000.0075-
0.6598153500.0174-
0.6619154000.0084-
0.6641154500.0053-
0.6662155000.0117-
0.6684155500.0110-
0.6705156000.0131-
0.6727156500.0080-
0.6748157000.0099-
0.6770157500.0073-
0.6791158000.0030-
0.6813158500.0085-
0.6834159000.0118-
0.6856159500.0075-
0.6877160000.01130.0060

</details>

Training Time

  • —Training: 6.1 hours

Framework Versions

  • —Python: 3.12.13
  • —Sentence Transformers: 5.4.1
  • —Transformers: 5.0.0
  • —PyTorch: 2.10.0+cu128
  • —Accelerate: 1.13.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. -->