CoolFace
Modelpublic

kaamd/ll

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes11downloads
Model Card

SentenceTransformer

This is a sentence-transformers model trained on the fiqa dataset. It maps sentences & paragraphs to a 4096-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: Unknown -->
  • Maximum Sequence Length: 32768 tokens
  • Output Dimensionality: 4096 dimensions
  • Similarity Function: Cosine Similarity
  • Training Dataset:
  • fiqa <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 32768, 'do_lower_case': False, 'architecture': 'MistralModel'})
  (1): Pooling({'word_embedding_dimension': 4096, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': True, 'include_prompt': True})
  (2): SparseEmbedding(
    (sparsifyer): ZeroNeuron(in_features=4096, out_features=4096)
  )
)

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: Given a web search query, retrieve relevant passages that answer the query\nQuery: I am under 18 years old, in the US, my parents have terrible credit, how can I take out a loan?',
    "Depending on the state this might not be possible. Loans are considered contracts, and various states regulate how minors may enter into them. For example, in the state of Oregon, a minor may NOT enter into a contract without their parent being on the contract as well. So you are forced to wait until you turn 18. At that time you won't have a credit history, and to lenders that often is worse than having bad credit. I can't help with the car (other than to recommend you buy a junker for $500-$1,000 and just live with it for now), but you could certainly get a secured credit card or line of credit from your local bank. The way they are arranged is, you make a deposit of an amount of your choosing (generally at least $200 for credit cards, and $1,000 for lines of credit), and receive a revolving line with a limit of that same amount. As you use and pay on this loan, it will be reported in your credit history. If you start that now, by the time you turn 18 you will have much better options for purchasing vehicles.",
    "In the equity markets, the P/E is usually somewhere around 15.  The P/E can be viewed as the inverse of the rate of a perpetuity. Since the average is 15, and the E/P of that would be 6.7%, r should be 6.7% on average. If your business is growing, the growth rate can be incorporated like so: As you can see, a high g would make the price negative, in essence the seller should actually pay someone to take the business, but in reality, r is determined from the p and an estimated g. For a business of any growth rate, it's best to compare the multiple to the market, so for the average business in the market with your business's growth rate and industry, that P/E would be best applied to your company's income.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 4096]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.6277, 0.2807],
#         [0.6277, 1.0000, 0.2775],
#         [0.2807, 0.2775, 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

fiqa
  • Dataset: fiqa
  • Size: 14,166 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: 24 tokens</li><li>mean: 36.38 tokens</li><li>max: 62 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 223.61 tokens</li><li>max: 1683 tokens</li></ul> |
  • Samples: | anchor | positive | |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Instruct: Given a web search query, retrieve relevant passages that answer the query<br>Query: What is considered a business expense on a business trip?</code> | <code>The IRS Guidance pertaining to the subject. In general the best I can say is your business expense may be deductible. But it depends on the circumstances and what it is you want to deduct. Travel Taxpayers who travel away from home on business may deduct related expenses, including the cost of reaching their destination, the cost of lodging and meals and other ordinary and necessary expenses. Taxpayers are considered “traveling away from home” if their duties require them to be away from home substantially longer than an ordinary day’s work and they need to sleep or rest to meet the demands of their work. The actual cost of meals and incidental expenses may be deducted or the taxpayer may use a standard meal allowance and reduced record keeping requirements. Regardless of the method used, meal deductions are generally limited to 50 percent as stated earlier. Only actual costs for lodging may be claimed as an expense and receipts must be kept for documentation. ...</code> | | <code>Instruct: Given a web search query, retrieve relevant passages that answer the query<br>Query: Business Expense - Car Insurance Deductible For Accident That Occurred During a Business Trip</code> | <code>As a general rule, you must choose between a mileage deduction or an actual expenses deduction. The idea is that the mileage deduction is supposed to cover all costs of using the car. Exceptions include parking fees and tolls, which can be deducted separately under either method. You explicitly cannot deduct insurance costs if you claim a mileage deduction. Separately, you probably won't be able to deduct the deductible for your car as a casualty loss. You first subtract $100 from the deductible and then divide it by your Adjusted Gross Income (AGI) from your tax return. If your deductible is over 10% of your AGI, you can deduct it. Note that even with a $1500 deductible, you won't be able to deduct anything if you made more than $14,000 for the year. For most people, the insurance deductible just isn't large enough relative to income to be tax deductible. Source</code> | | <code>Instruct: Given a web search query, retrieve relevant passages that answer the query<br>Query: Starting a new online business</code> | <code>Most US states have rules that go something like this: You will almost certainly have to pay some registration fees, as noted above. Depending on how you organize, you may or may not need to file a separate tax return for the business. (If you're sole proprietor for tax purposes, then you file on Schedule C on your personal Form 1040.) Whether or not you pay taxes depends on whether you have net income. It's possible that some losses might also be deductible. (Note that you may have to file a return even if you don't have net income - Filing and needing to pay are not the same since your return may indicate no tax due.) In addition, at the state level, you may have to pay additional fees or taxes beyond income tax depending on what you sell and how you sell it. (Sales tax, for example, might come into play as might franchise taxes.) You'll need to check your own state law for that. As always, it could be wise to get professional tax and accounting advice that's tailored to your si...</code> |
  • Loss: <code>zero-neuron.src.embedding.sparse_loss.SparseLoss</code>

Training Hyperparameters

Non-Default Hyperparameters
  • per_device_eval_batch_size: 16
  • learning_rate: 0.0005
  • num_train_epochs: 2
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.01
  • save_safetensors: False
  • bf16: True
  • remove_unused_columns: False
  • batch_sampler: no_duplicates
All Hyperparameters

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

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 8
  • per_device_eval_batch_size: 16
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 0.0005
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 2
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.01
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: False
  • 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
  • use_ipex: False
  • bf16: True
  • 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: False
  • label_names: None
  • load_best_model_at_end: False
  • 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}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • 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: False
  • 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: 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 Loss
0.0056101.1694
0.0113201.2809
0.0169301.2538
0.0226401.2237
0.0282501.1809
0.0339601.1602
0.0395701.2008
0.0452801.1064
0.0508901.0857
0.05651001.0553
0.06211101.0513
0.06781200.9236
0.07341300.8998
0.07911400.8509
0.08471500.7769
0.09031600.7268
0.09601700.7287
0.10161800.6437
0.10731900.6653
0.11292000.5888
0.11862100.6097
0.12422200.6939
0.12992300.5969
0.13552400.5333
0.14122500.5143
0.14682600.6152
0.15252700.4779
0.15812800.5182
0.16372900.5724
0.16943000.5073
0.17503100.4924
0.18073200.5219
0.18633300.5621
0.19203400.4535
0.19763500.4818
0.20333600.4773
0.20893700.4948
0.21463800.4277
0.22023900.5043
0.22594000.5746
0.23154100.4762
0.23724200.4432
0.24284300.4771
0.24844400.5298
0.25414500.4352
0.25974600.5714
0.26544700.508
0.27104800.5215
0.27674900.5096
0.28235000.4598
0.28805100.5843
0.29365200.5581
0.29935300.4686
0.30495400.4956
0.31065500.4209
0.31625600.4181
0.32195700.4847
0.32755800.5193
0.33315900.4235
0.33886000.4626
0.34446100.4309
0.35016200.451
0.35576300.4742
0.36146400.4892
0.36706500.4478
0.37276600.4461
0.37836700.5197
0.38406800.4692
0.38966900.4272
0.39537000.4196
0.40097100.4737
0.40657200.4015
0.41227300.4786
0.41787400.3968
0.42357500.4499
0.42917600.478
0.43487700.4003
0.44047800.4679
0.44617900.4129
0.45178000.452
0.45748100.4238
0.46308200.4761
0.46878300.4324
0.47438400.4535
0.48008500.4914
0.48568600.5368
0.49128700.4106
0.49698800.419
0.50258900.3884
0.50829000.4833
0.51389100.4295
0.51959200.3673
0.52519300.4245
0.53089400.4636
0.53649500.3897
0.54219600.4342
0.54779700.442
0.55349800.4443
0.55909900.3737
0.564710000.441
0.570310100.4247
0.575910200.4583
0.581610300.4077
0.587210400.5236
0.592910500.4307
0.598510600.5054
0.604210700.4787
0.609810800.4521
0.615510900.4011
0.621111000.3864
0.626811100.4191
0.632411200.436
0.638111300.4469
0.643711400.4416
0.649411500.4475
0.655011600.3857
0.660611700.3571
0.666311800.441
0.671911900.4144
0.677612000.4108
0.683212100.4051
0.688912200.489
0.694512300.3881
0.700212400.4971
0.705812500.415
0.711512600.4048
0.717112700.3805
0.722812800.3869
0.728412900.3804
0.734013000.4141
0.739713100.4223
0.745313200.3836
0.751013300.4012
0.756613400.4725
0.762313500.3946
0.767913600.4424
0.773613700.4256
0.779213800.4381
0.784913900.3634
0.790514000.3568
0.796214100.4158
0.801814200.3982
0.807514300.4734
0.813114400.3787
0.818714500.4492
0.824414600.4504
0.830014700.4125
0.835714800.4059
0.841314900.419
0.847015000.4269
0.852615100.5586
0.858315200.4664
0.863915300.5185
0.869615400.422
0.875215500.5141
0.880915600.4576
0.886515700.372
0.892215800.4194
0.897815900.4074
0.903416000.3894
0.909116100.4172
0.914716200.4274
0.920416300.4013
0.926016400.4072
0.931716500.3616
0.937316600.3485
0.943016700.4478
0.948616800.4543
0.954316900.4229
0.959917000.4186
0.965617100.378
0.971217200.3753
0.976817300.4575
0.982517400.4291
0.988117500.4288
0.993817600.3678
0.999417700.5298
1.005117800.3926
1.010717900.3799
1.016418000.4288
1.022018100.4323
1.027718200.4371
1.033318300.4652
1.039018400.3565
1.044618500.4567
1.050318600.3947
1.055918700.3868
1.061518800.4143
1.067218900.482
1.072819000.3763
1.078519100.3795
1.084119200.4413
1.089819300.4761
1.095419400.3907
1.101119500.4066
1.106719600.3905
1.112419700.3944
1.118019800.4022
1.123719900.398
1.129320000.3473
1.135020100.4357
1.140620200.3823
1.146220300.3628
1.151920400.403
1.157520500.3965
1.163220600.3837
1.168820700.5012
1.174520800.3959
1.180120900.3661
1.185821000.4603
1.191421100.4607
1.197121200.4241
1.202721300.5183
1.208421400.3533
1.214021500.3877
1.219621600.4298
1.225321700.4228
1.230921800.4131
1.236621900.4034
1.242222000.3834
1.247922100.4183
1.253522200.5475
1.259222300.4755
1.264822400.4478
1.270522500.3763
1.276122600.4493
1.281822700.4001
1.287422800.3765
1.293122900.3379
1.298723000.337
1.304323100.4143
1.310023200.4794
1.315623300.4004
1.321323400.3674
1.326923500.3963
1.332623600.3896
1.338223700.5062
1.343923800.4114
1.349523900.3955
1.355224000.4682
1.360824100.3551
1.366524200.3536
1.372124300.3784
1.377824400.3456
1.383424500.4273
1.389024600.4005
1.394724700.3957
1.400324800.3371
1.406024900.3451
1.411625000.4735
1.417325100.4013
1.422925200.3751
1.428625300.365
1.434225400.3548
1.439925500.4227
1.445525600.3626
1.451225700.404
1.456825800.4055
1.462525900.4513
1.468126000.4147
1.473726100.3623
1.479426200.404
1.485026300.4
1.490726400.3854
1.496326500.4082
1.502026600.3502
1.507626700.4022
1.513326800.4479
1.518926900.3456
1.524627000.3992
1.530227100.4143
1.535927200.3925
1.541527300.366
1.547127400.4254
1.552827500.4337
1.558427600.471
1.564127700.4201
1.569727800.4357
1.575427900.4289
1.581028000.4287
1.586728100.4349
1.592328200.4551
1.598028300.3562
1.603628400.4925
1.609328500.4104
1.614928600.4691
1.620628700.383
1.626228800.3612
1.631828900.4584
1.637529000.3828
1.643129100.3784
1.648829200.4148
1.654429300.4535
1.660129400.3523
1.665729500.3501
1.671429600.3703
1.677029700.388
1.682729800.3846
1.688329900.4212
1.694030000.4192
1.699630100.4265
1.705330200.4385
1.710930300.4197
1.716530400.3488
1.722230500.3666
1.727830600.3909
1.733530700.5085
1.739130800.3495
1.744830900.4198
1.750431000.3647
1.756131100.3873
1.761731200.4038
1.767431300.4471
1.773031400.4078
1.778731500.3823
1.784331600.4852
1.789931700.3891
1.795631800.4334
1.801231900.3836
1.806932000.4
1.812532100.4126
1.818232200.3767
1.823832300.4085
1.829532400.3919
1.835132500.358
1.840832600.3709
1.846432700.4131
1.852132800.4082
1.857732900.4547
1.863433000.4317
1.869033100.3981
1.874633200.4585
1.880333300.3698
1.885933400.3662
1.891633500.3955
1.897233600.4387
1.902933700.5001
1.908533800.3708
1.914233900.4448
1.919834000.3632
1.925534100.4589
1.931134200.4085
1.936834300.3993
1.942434400.4598
1.948134500.4019
1.953734600.4179
1.959334700.3804
1.965034800.4229
1.970634900.3933
1.976335000.4217
1.981935100.4182
1.987635200.5265
1.993235300.403
1.998935400.3758

</details>

Framework Versions

  • Python: 3.10.16
  • Sentence Transformers: 5.1.1
  • Transformers: 4.55.4
  • PyTorch: 2.6.0+cu124
  • Accelerate: 1.8.0.dev0
  • Datasets: 3.2.0
  • Tokenizers: 0.21.4

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