Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/huggingface/sentence-transformers
/ functions
Functions
3,759 in github.com/huggingface/sentence-transformers
⨍
Functions
3,759
◇
Types & classes
446
↳
Endpoints
48
Method
old_fit
Deprecated training method from before Sentence Transformers v4.0, it is recommended to use :class:`~sentence_transformers.cross_enco
sentence_transformers/cross_encoder/fit_mixin.py:407
Function
onLoad
()
docs/_static/js/custom.js:32
Method
on_epoch_end
( self, args: SentenceTransformerTrainingArguments, state: TrainerState, contr
sentence_transformers/sentence_transformer/fit_mixin.py:109
Method
on_epoch_end
( self, args: CrossEncoderTrainingArguments, state: TrainerState, control: Tra
sentence_transformers/cross_encoder/fit_mixin.py:95
Method
on_evaluate
( self, args: SentenceTransformerTrainingArguments, state: TrainerState, contr
sentence_transformers/sentence_transformer/fit_mixin.py:62
Method
on_evaluate
( self, args: CrossEncoderTrainingArguments, state: TrainerState, control: Tra
sentence_transformers/cross_encoder/fit_mixin.py:59
Method
on_evaluate
( self, args: BaseTrainingArguments, state: TrainerState, control: TrainerCont
sentence_transformers/base/model_card.py:186
Method
on_log
Log the current weight values.
sentence_transformers/sparse_encoder/callbacks/splade_callbacks.py:144
Method
on_log
( self, args: BaseTrainingArguments, state: TrainerState, control: TrainerCont
sentence_transformers/base/model_card.py:219
Method
on_model_ready
(self, model: BaseModel)
sentence_transformers/multi_vector_encoder/modules/multi_vector_mask.py:89
Method
on_model_ready
(self, model: BaseModel)
sentence_transformers/base/modules/router.py:520
Method
on_model_ready
(self, model)
tests/base/modules/test_router.py:53
Method
on_step_begin
Update weight values at the beginning of each step.
sentence_transformers/sparse_encoder/callbacks/splade_callbacks.py:114
Method
on_step_end
( self, args: SentenceTransformerTrainingArguments, state: TrainerState, control: TrainerControl,
examples/sentence_transformer/training/data_augmentation/train_sts_seed_optimization.py:112
Method
on_train_begin
Initialize the scheduler at the beginning of training.
sentence_transformers/sparse_encoder/callbacks/splade_callbacks.py:74
Method
on_train_begin
( self, args: BaseTrainingArguments, state: TrainerState, control: TrainerCont
sentence_transformers/base/model_card.py:142
Method
on_train_end
( self, args: SentenceTransformerTrainingArguments, state: TrainerState, contr
sentence_transformers/sentence_transformer/fit_mixin.py:79
Method
one_to_many
(query_embeddings: Tensor | list[Tensor], document_embeddings: list[Tensor])
sentence_transformers/multi_vector_encoder/evaluation/reranking.py:93
Function
paraphrase_distilroberta_base_v1_model
()
tests/conftest.py:101
Method
partition_mode
(self)
sentence_transformers/sentence_transformer/losses/cached_multiple_negatives_ranking.py:233
Function
passages
Return a list of sample passages.
tests/util/test_hard_negatives.py:64
Function
patch_torchcodec_int64_indices
Coerce numpy frame indices to int64 for torchcodec on Windows. transformers' video samplers return numpy int arrays, which are int32 on Windows
tests/base/modules/transformer/conftest.py:202
Method
patched_from_pretrained
(*args, **kwargs)
tests/base/modules/test_transformer.py:141
Function
patched_init
(self, *args, **kwargs)
tests/sentence_transformer/test_model.py:1376
Function
patched_save
(self, path, safe_serialization=None)
tests/base/test_model.py:456
Function
peft_wrapper
Wrapper to call the method on the auto_model with a check for PEFT compatibility.
sentence_transformers/base/peft_mixin.py:8
Method
plain_func
(x)
tests/base/modules/test_transformer.py:1573
Method
pool_one
(self, embedding: Tensor, **kwargs)
sentence_transformers/multi_vector_encoder/modules/token_pooling.py:266
Method
pool_one
(self, embedding: Tensor, **kwargs)
sentence_transformers/multi_vector_encoder/modules/token_pooling.py:297
Function
prepare_dataset
(batch)
examples/sentence_transformer/training/multilingual/make_multilingual.py:129
Method
prepare_loss
( self, loss: Callable[[SparseEncoder], torch.nn.Module] | torch.nn.Module, model: Spa
sentence_transformers/sparse_encoder/trainer.py:172
Method
preprocess
(self, inputs: list[str], prompt: str | None = None, **kwargs)
sentence_transformers/sentence_transformer/modules/word_embeddings.py:71
Method
preprocess
(self, inputs: list[str], prompt: str | None = None, **kwargs)
sentence_transformers/sentence_transformer/modules/static_embedding.py:111
Function
preprocess_docstring
(app, obj_type: str, name: str, obj, options: sphinx.ext.autodoc.Options, lines: list[str])
docs/conf.py:188
Function
preprocess_fn
(texts, prompt=None, task=None)
tests/base/test_data_collator.py:14
Function
preprocess_tracker
(texts, prompt=None, **kwargs)
tests/sentence_transformer/test_trainer.py:398
Function
preprocess_tracker
(texts, prompt=None, **kwargs)
tests/sparse_encoder/test_trainer.py:201
Method
process
(max_length, restore_suffix=True)
tests/base/modules/test_transformer.py:1489
Function
queries
()
tests/util/test_dataset.py:14
Function
queries
Return a list of sample queries.
tests/util/test_hard_negatives.py:58
Method
query_expansion
ColBERT-style query expansion config. See :class:`QueryExpansionConfig`. Validated and normalized on assignment, so re-setting after construct
sentence_transformers/base/modules/transformer.py:985
Method
raise_boom
(*a, **kw)
tests/base/modules/test_transformer.py:1581
Function
raise_oserror
(*args, **kwargs)
tests/util/test_misc.py:103
Function
record
(a, b, a_mask, b_mask)
tests/util/test_similarity.py:960
Function
recording_init
(self, *args, **kwargs)
tests/base/test_trainer.py:177
Method
register_model
(self, model: MultiVectorEncoder)
sentence_transformers/multi_vector_encoder/model_card.py:76
Method
register_model
(self, model)
sentence_transformers/cross_encoder/model_card.py:154
Method
register_model
(self, model: SparseEncoder)
sentence_transformers/sparse_encoder/model_card.py:92
Method
report
(self)
examples/sentence_transformer/evaluation/evaluation_no_dup_batch_sampler_speed.py:343
Function
reranker_bert_tiny_model
(_reranker_bert_tiny_model)
tests/conftest.py:147
Function
reranker_bert_tiny_model_v54
(_reranker_bert_tiny_model_v54)
tests/cross_encoder/conftest.py:21
Function
restore_cross_encoder_class
trust_remote_code models may patch the CrossEncoder class itself at import time (zeroentropy/zerank-1-small replaces CrossEncoder.to and CrossEnco
tests/cross_encoder/test_pretrained.py:28
Method
run_usage_snippet
(self)
sentence_transformers/sentence_transformer/model_card.py:90
Method
run_usage_snippet
(self)
sentence_transformers/multi_vector_encoder/model_card.py:111
Method
run_usage_snippet
(self)
sentence_transformers/cross_encoder/model_card.py:164
Method
run_usage_snippet
(self)
sentence_transformers/sparse_encoder/model_card.py:137
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sentence_transformer/modules/bow.py:89
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sentence_transformer/modules/dropout.py:26
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sentence_transformer/modules/weighted_layer_pooling.py:50
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sentence_transformer/modules/static_embedding.py:132
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sentence_transformer/modules/layer_norm.py:28
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sentence_transformer/modules/word_weights.py:69
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sentence_transformer/modules/lstm.py:66
Method
save
(self, output_path: str)
sentence_transformers/sentence_transformer/modules/tokenizer/word.py:412
Method
save
(self, output_path: str)
sentence_transformers/sentence_transformer/modules/tokenizer/word.py:436
Method
save
(self, output_path: str)
sentence_transformers/sentence_transformer/modules/tokenizer/phrase.py:104
Method
save
(self, output_path: str)
sentence_transformers/sentence_transformer/modules/tokenizer/whitespace.py:62
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/multi_vector_encoder/modules/token_pooling.py:186
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/multi_vector_encoder/modules/multi_vector_mask.py:154
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sparse_encoder/modules/sparse_static_embedding.py:99
Method
save
(self, output_path, safe_serialization: bool = True)
sentence_transformers/sparse_encoder/modules/sparse_auto_encoder.py:202
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/sparse_encoder/modules/splade_pooling.py:164
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
sentence_transformers/base/modules/normalize.py:45
Method
save
(self, output_path: str, safe_serialization: bool = True, **kwargs)
sentence_transformers/base/modules/router.py:552
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
tests/base/modules/test_router.py:56
Method
save
(self, output_path: str, *args, safe_serialization: bool = True, **kwargs)
tests/base/modules/test_router.py:580
Method
save
(self, output_path, *args, safe_serialization=True, **kwargs)
tests/base/modules/test_input_module.py:19
Method
save
(self, output_path, *args, safe_serialization=True, **kwargs)
tests/base/modules/test_input_module.py:34
Method
save
(self, output_path, *args, safe_serialization=True, **kwargs)
tests/base/modules/test_input_module.py:44
Function
save_to_hub_args_decorator
A decorator to update the signature of the :class:`~sentence_transformers.base.model.BaseModel.save_to_hub` method to replace the deprecated
sentence_transformers/util/decorators.py:208
Method
set_epoch
(self, epoch: int)
sentence_transformers/base/sampler.py:191
Method
set_label_examples
(self, dataset: Dataset)
sentence_transformers/base/model_card.py:945
Method
set_vocab
(self, vocab: Iterable[str])
sentence_transformers/sentence_transformer/modules/tokenizer/word.py:430
Method
set_widget_examples
We don't set widget examples, but only load the prediction example. This is because the Hugging Face Hub doesn't currently have a Sen
sentence_transformers/cross_encoder/model_card.py:100
Function
setup
(app: Sphinx)
docs/conf.py:323
Method
setup_method
(self)
tests/base/test_modality.py:566
Method
setup_method
(self)
tests/base/test_modality.py:1127
Method
setup_method
(self)
tests/base/test_modality.py:1223
Function
simcse_map
(example)
examples/sentence_transformer/unsupervised_learning/SimCSE/train_stsb_simcse.py:40
Method
similarity_fn_name
Return the name of the similarity function. If not previously set, accessing this property defaults it to ``"cosine"``.
sentence_transformers/sentence_transformer/model.py:1028
Method
similarity_fn_name
The similarity function used by :meth:`similarity` and :meth:`similarity_pairwise`. Set it to ``"meanmaxsim"`` for a model trained with length
sentence_transformers/multi_vector_encoder/model.py:936
Method
similarity_fn_name
Return the name of the similarity function used by :meth:`SparseEncoder.similarity` and :meth:`SparseEncoder.similarity_pairwise`. Returns:
sentence_transformers/sparse_encoder/model.py:806
Method
similarity_pairwise
Compute the pairwise similarity between two collections of embeddings, i.e. the similarity between ``embeddings1[i]`` and ``embedding
sentence_transformers/sentence_transformer/model.py:1075
Method
similarity_pairwise
Compute the pairwise score vector between matched query / document pairs, using this model's :attr:`similarity_fn_name`. Args:
sentence_transformers/multi_vector_encoder/model.py:1010
Function
similarity_spy
(embeddings1, embeddings2)
tests/util/test_hard_negatives.py:863
Function
simulate_rank1_world2
Run the rank=1/world=2 gather path in a single process: ``all_gather_with_grad`` prepends a deterministic rank-0 block, and the rank is reported a
tests/sentence_transformer/losses/test_gist_embed.py:37
Function
simulate_rank1_world2
Monkeypatch the distributed helpers so ``calculate_loss`` runs the rank=1/world=2 gather path in a single process: ``all_gather_with_grad`` prepen
tests/sentence_transformer/losses/test_cached_gist_embed.py:34
Method
smart_batching_collate
Transforms a batch from a SmartBatchingDataset to a batch of tensors for the model Here, batch is a list of InputExample instances: [
sentence_transformers/sentence_transformer/fit_mixin.py:428
Method
smart_batching_collate
(self, batch: list[InputExample])
sentence_transformers/cross_encoder/fit_mixin.py:361
Method
smart_batching_collate_text_only
(self, batch: list[InputExample])
sentence_transformers/cross_encoder/fit_mixin.py:387
← previous
next →
1,801–1,900 of 3,759, ranked by callers