Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/huggingface/sentence-transformers
/ functions
Functions
4,575 in github.com/huggingface/sentence-transformers
⨍
Functions
4,575
◇
Types & classes
516
↳
Endpoints
81
Method
pool_one
(self, embedding: Tensor)
tests/multi_vector_encoder/losses/test_token_pooling.py:305
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, **kwargs)
tests/base/test_distributed_evaluation.py:27
Function
preprocess_docstring
(app, obj_type: str, name: str, obj, options: sphinx.ext.autodoc.Options, lines: list[str])
docs/conf.py:202
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:500
Function
preprocess_tracker
(texts, prompt=None, **kwargs)
tests/sparse_encoder/test_trainer.py:203
Method
process
(max_length, restore_suffix=True)
tests/base/modules/test_transformer.py:1699
Method
processor_with_labels
(*args, **kwargs)
tests/base/modules/test_transformer.py:549
Function
pytest_collection_modifyitems
(items: list[pytest.Item])
tests/conftest.py:121
Function
queries
()
tests/util/test_dataset.py:15
Function
queries
Return a list of sample queries.
tests/util/test_hard_negatives.py:60
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:1030
Method
raise_boom
(*a, **kw)
tests/base/modules/test_transformer.py:1851
Function
raise_oserror
(*args, **kwargs)
tests/util/test_misc.py:151
Function
record
(emb)
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:206
Function
record
(a, b, a_mask, b_mask)
tests/util/test_similarity.py:1062
Method
record
(distances, lengths, cluster_counts)
tests/multi_vector_encoder/modules/test_token_pooling.py:157
Function
record_batch
(batch, **parameters)
tests/test_merging.py:229
Function
recording_init
(self, *args, **kwargs)
tests/base/test_trainer.py:189
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
Function
regression_loss
(logits: torch.Tensor, labels: torch.Tensor)
tests/sentence_transformer/losses/test_softmax.py:79
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:214
Function
reranker_bert_tiny_model_v54
(_reranker_bert_tiny_model_v54)
tests/cross_encoder/conftest.py:26
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:133
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:70
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:205
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:222
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)
tests/base/test_model.py:2007
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:605
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:225
Function
select_first
(group: merge_methods.TensorGroup)
tests/test_merging.py:134
Method
set_epoch
(self, epoch: int)
sentence_transformers/base/sampler.py:712
Method
set_label_examples
(self, dataset: Dataset)
sentence_transformers/base/model_card.py:961
Method
set_vocab
(self, vocab: Iterable[str])
sentence_transformers/sentence_transformer/modules/tokenizer/word.py:400
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:337
Method
setup_method
(self)
tests/base/test_modality.py:567
Method
setup_method
(self)
tests/base/test_modality.py:1128
Method
setup_method
(self)
tests/base/test_modality.py:1224
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:1041
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:1044
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:842
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:1088
Function
similarity_spy
(embeddings1, embeddings2)
tests/util/test_hard_negatives.py:946
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:136
Method
singleton
(distances, lengths, cluster_counts)
tests/multi_vector_encoder/modules/test_token_pooling.py:170
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:441
Method
smart_batching_collate
(self, batch: list[InputExample])
sentence_transformers/cross_encoder/fit_mixin.py:370
Method
smart_batching_collate_text_only
(self, batch: list[InputExample])
sentence_transformers/cross_encoder/fit_mixin.py:396
Method
sort_metrics
(key: str)
sentence_transformers/base/model_card.py:1555
Function
sparse_tensors
Create two large sparse tensors of shape (50, 100) each.
tests/util/test_similarity.py:161
Function
splade_bert_tiny_model
(_splade_bert_tiny_model: SparseEncoder)
tests/conftest.py:228
Method
splade_pooling_chunk_size
Returns the chunk size of the SpladePooling module, if present. This chunk size is along the sequence length dimension (i.e., number
sentence_transformers/sparse_encoder/model.py:1293
Function
spy
(**kwargs)
tests/sentence_transformer/losses/test_cached_gist_embed.py:370
Function
spy
(**kwargs)
tests/sentence_transformer/losses/test_mega_batch_margin.py:96
Function
spy
(**kwargs)
tests/sentence_transformer/losses/test_gradcache.py:105
Function
spy
(inputs, prompt=None, task=None, **kwargs)
tests/multi_vector_encoder/test_trainer.py:190
Function
spy
(**kwargs)
tests/cross_encoder/losses/test_cached_multiple_negatives_ranking.py:76
Function
spy
(**kwargs)
tests/sparse_encoder/losses/test_cached_splade.py:262
Function
spy
(**kwargs)
tests/base/modules/test_router.py:296
Method
spy
(**kwargs)
tests/base/modules/test_transformer.py:1038
Function
spy_encode
(*args, **kwargs)
tests/sentence_transformer/test_model.py:1036
Function
spy_encode
(*args, **kwargs)
tests/sparse_encoder/test_model.py:281
Function
spy_forward
(*args, **kwargs)
tests/sparse_encoder/test_model.py:315
Method
start
(self)
examples/sentence_transformer/evaluation/evaluation_no_dup_batch_sampler_speed.py:329
Function
start_pool
(*args, **kwargs)
tests/base/test_multi_process.py:207
Function
static_embedding_model
(static_embedding: StaticEmbedding)
tests/conftest.py:296
Function
static_retrieval_mrl_en_v1_model
(_static_retrieval_mrl_en_v1_model: SentenceTransformer)
tests/conftest.py:179
Method
stop
(self)
examples/sentence_transformer/evaluation/evaluation_no_dup_batch_sampler_speed.py:335
Function
stsb_bert_tiny_model
(_stsb_bert_tiny_model: SentenceTransformer)
tests/conftest.py:148
Function
stsb_dataset_dict
()
tests/conftest.py:303
← previous
next →
2,101–2,200 of 4,575, ranked by callers