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
test_widget_examples_skip_empty_texts
(self, empty_column, as_dict)
tests/base/test_model_card.py:139
Method
test_widget_examples_skipped_when_transform_fails
(self)
tests/base/test_model_card.py:107
Method
test_width_cutoff_sits_at_32_characters
(self)
tests/util/test_dataset.py:465
Method
test_with_exception_in_get_type_hints
Should return None when get_type_hints raises.
tests/base/modules/test_transformer.py:1848
Method
test_with_model_output_return_type
Should extract field names from a ModelOutput return type, and validate _infer_method_output_name.
tests/base/modules/test_transformer.py:1829
Method
test_with_no_return_annotation
Should return None when method has no return type annotation.
tests/base/modules/test_transformer.py:1840
Method
test_with_save_dir_and_source_path
VideoDecoder with save_dir and source file produces <video> tag.
tests/base/test_model_card.py:1322
Method
test_without_save_dir_returns_placeholder
Without save_dir, returns text placeholder in <code> tag.
tests/base/test_model_card.py:1361
Function
test_word_embeddings_encode_empty_tokens_batch_invariance
(encoder, batch_size)
tests/sentence_transformer/modules/test_word_embeddings.py:152
Function
test_word_embeddings_load_routes_tokenizer_class_through_trust_gate
`WordEmbeddings.load` must resolve the config-controlled `tokenizer_class` through the `import_module_class` trust gate, forwarding `model_name_or
tests/sentence_transformer/modules/test_word_embeddings.py:16
Function
test_word_embeddings_respects_max_seq_length
(prompt, expected_ids, expected_embeddings)
tests/sentence_transformer/modules/test_word_embeddings.py:110
Function
test_word_embeddings_save_load_round_trip_does_not_warn
A genuine WordEmbeddings model stores a `sentence_transformers.*` tokenizer class, so a real save/load round-trip resolves through the gate's name
tests/sentence_transformer/modules/test_word_embeddings.py:63
Function
test_workers_are_spawned_does_not_lock_in_the_start_method
Constructing training arguments must never fix the start method, which would make a later ``multiprocessing.set_start_method`` call raise.
tests/sentence_transformer/test_training_args.py:209
Method
test_works_on_methods
(self, caplog)
tests/util/test_decorators.py:76
Method
test_wrong_id_type_reports_not_found
(self)
tests/util/test_dataset.py:534
Method
test_wrong_tuple_length
(self, queries: Dataset)
tests/util/test_dataset.py:269
Function
test_xtr_kd_scores_gathers_own_document_groups
xtr_kd_scores returns each query's own N-way block of the xtr_scores cross-product.
tests/multi_vector_encoder/test_model.py:1937
Function
test_xtr_scores_chunk_budget_matches_single_matmul
chunk_elements is a pure memory knob: any budget reproduces the single matmul.
tests/multi_vector_encoder/test_model.py:1950
Function
test_xtr_scores_clamps_topk_to_token_pool
The default k=256 exceeds tiny in-batch token pools: top-k must clamp instead of crashing.
tests/multi_vector_encoder/test_model.py:999
Function
test_xtr_scores_derives_query_padding_mask
Implicit query padding behaves like an explicit mask and does not affect XTR scores.
tests/multi_vector_encoder/test_model.py:1034
Function
test_xtr_scores_fully_masked_document_scores_sentinel
An empty document surfaces differently per ``k`` (-inf when the top-k spans the pool, a retrievable-looking 0 below that): both regimes take the -
tests/multi_vector_encoder/test_model.py:1114
Function
test_xtr_scores_half_precision_accumulates_in_float32
XTR's own query-token sum accumulates in float32: an output cast alone cannot restore the resolution a bf16 sum loses.
tests/multi_vector_encoder/test_model.py:1097
Function
test_xtr_scores_keeps_retrieved_negative_similarities
Non-retrieved tokens are held at the dtype minimum, not 0: a zero placeholder wins the per-document max over a genuinely retrieved negative simila
tests/multi_vector_encoder/test_model.py:1050
Function
test_xtr_scores_rejects_non_positive_topk
Non-positive top-k values fail at the public scoring boundary with a clear error.
tests/multi_vector_encoder/test_model.py:1011
Function
test_xtr_scores_upcasts_integer_embeddings
Integer embeddings follow the floating-point scoring path and match float inputs.
tests/multi_vector_encoder/test_model.py:1021
Function
test_xtr_scores_without_mask_excludes_zero_pad_rows
On unnormalized embeddings a zero pad row scored 0.0 and beat genuinely negative real maxima: without a mask, one is now derived from all-zero doc
tests/multi_vector_encoder/test_model.py:1133
Function
test_xtr_scoring_callable_shape
()
tests/multi_vector_encoder/test_model.py:1781
Function
test_xtr_z_counts_retrieved_query_tokens
Z is the paper's retrieval count (query tokens that retrieved at least one document token), not the count of positive maxima: 3 positive + 1 negat
tests/multi_vector_encoder/test_model.py:1917
Method
test_youtube_mobile
(self)
tests/base/test_modality.py:81
Method
test_youtube_short
(self)
tests/base/test_modality.py:78
Method
test_youtube_url_with_spaces_not_video
(self)
tests/base/test_modality.py:90
Method
test_youtube_url_with_trailing_text_is_text
The exact case from the bug report: a YouTube URL followed by a description.
tests/base/test_modality.py:329
Method
test_youtube_www
(self)
tests/base/test_modality.py:75
Function
test_zero_cutoff
(documents: list[str])
tests/sparse_encoder/test_reciprocal_rank_fusion.py:141
Function
test_zero_dimension_raises_error
Test that zero dimension in matryoshka_dims raises ValueError.
tests/sentence_transformer/losses/test_matryoshka.py:57
Function
to_binary_flickr8k
Converts the Flickr8k dataset format to a binary classification format
examples/sentence_transformer/training/clip/training_clip_flickr8k_mlflow.py:27
Function
to_ct_pairs
(sample, pos_neg_ratio=8)
examples/sentence_transformer/unsupervised_learning/CT/train_ct_from_file.py:75
Function
to_ct_pairs
(sample, pos_neg_ratio=8)
examples/sentence_transformer/unsupervised_learning/CT/train_stsb_ct.py:36
Function
to_ct_pairs
(sample, pos_neg_ratio=8)
examples/sentence_transformer/unsupervised_learning/CT/train_askubuntu_ct.py:49
Method
to_html_list
(data: dict)
sentence_transformers/base/model_card.py:1214
Method
to_yaml
(self, line_break=None)
sentence_transformers/base/model_card.py:2051
Function
tokenize
(batch)
examples/sentence_transformer/unsupervised_learning/MLM/train_mlm.py:46
Method
tokenize
(self, sentence: str)
sentence_transformers/sentence_transformer/modules/tokenizer/word.py:426
Method
tokenize
(self, text: str, **kwargs)
sentence_transformers/sentence_transformer/modules/tokenizer/phrase.py:63
Method
tokenize
(self, text: str, **kwargs)
sentence_transformers/sentence_transformer/modules/tokenizer/whitespace.py:32
Method
tokenize
(self, texts, **kwargs)
tests/base/modules/test_router.py:602
Method
tokenizer
The tokenizer, extracted from the processor. Returns ``None`` for non-text processors.
sentence_transformers/base/modules/transformer.py:1221
Method
tokenizer
(self)
sentence_transformers/base/modules/router.py:719
Function
torch_embeddings
(model_dir: str)
tests/multi_vector_encoder/test_backends.py:42
Method
transform
(batch)
tests/base/test_model_card.py:89
Function
transformer_kwargs_decorator
Decorator for :class:`Transformer.__init__` that handles deprecated keyword arguments. Handles the following legacy kwargs: * ``model_args``
sentence_transformers/util/decorators.py:53
Function
transformers_init
(*args, **kwargs)
tests/sentence_transformer/test_model.py:541
Method
transformers_model
Property to get the underlying transformers PreTrainedModel instance, if it exists. Note that it's possible for a model to have multi
sentence_transformers/sparse_encoder/model.py:1262
Function
triplet_dataset
()
tests/multi_vector_encoder/test_trainer.py:26
Method
truncate_sentence_embeddings
(self, truncate_dim: int | None)
sentence_transformers/sentence_transformer/model.py:1234
Method
try_to_float
(metric_value)
sentence_transformers/base/model_card.py:1480
Method
try_to_pure_python
Try to convert a value from a Numpy or Torch scalar to pure Python, if not already pure Python
sentence_transformers/base/model_card.py:1438
Method
try_to_set_base_model
(self)
sentence_transformers/sentence_transformer/model_card.py:84
Function
two_label_dataset
100 samples, 2 labels with 50 samples each.
tests/base/samplers/test_group_by_label_batch_sampler.py:23
Function
two_rank_gather
(tensor: Tensor, mask: Tensor, with_grad: bool = False)
tests/multi_vector_encoder/losses/test_misc.py:571
Function
unavailable
(*args, **kwargs)
tests/test_kernels.py:887
Method
unpad_inputs
Whether text-only inputs are concatenated without padding for faster inference. Non-text inputs (images, audio, video) are always padded norm
sentence_transformers/base/modules/transformer.py:1004
Function
upload_folder
(folder_path, **kwargs)
tests/backend/test_utils.py:129
Function
upper_transform
(batch)
tests/sentence_transformer/test_trainer.py:531
Function
upper_transform
(batch)
tests/sparse_encoder/test_trainer.py:234
Function
use_kernel_forward_from_hub
(name)
sentence_transformers/util/kernels.py:19
Function
varlen_features
Triplet batch where the positive column has 10 tokens and the negative has 14. This is the case that fails the pre-fix ``torch.stack(embeddings[1:
tests/multi_vector_encoder/losses/test_misc.py:55
Function
visit_download_reference
(self, node)
docs/conf.py:178
Method
warn_if_unsupported
(param: str, expected_value: bool, is_supported: bool, min_version: str)
sentence_transformers/base/modules/transformer.py:2335
Method
weight
(self)
sentence_transformers/sparse_encoder/modules/sparse_auto_encoder.py:26
Function
word_embeddings_model
(_word_embeddings_model: SentenceTransformer)
tests/conftest.py:168
Function
word_embeddings_model
()
tests/sentence_transformer/losses/test_embed_distill.py:259
Function
wrapper
(*args, **kwargs)
sentence_transformers/sentence_transformer/modules/pooling.py:55
Function
wrapper
(self, *args, **kwargs)
sentence_transformers/base/peft_mixin.py:12
Function
wrapper
(*args, **kwargs)
sentence_transformers/util/decorators.py:35
← previous
4,501–4,575 of 4,575, ranked by callers