MCPcopy Create free account

hub / github.com/huggingface/sentence-transformers / functions

Functions4,575 in github.com/huggingface/sentence-transformers

Methodtest_widget_examples_skip_empty_texts
(self, empty_column, as_dict)
tests/base/test_model_card.py:139
Methodtest_widget_examples_skipped_when_transform_fails
(self)
tests/base/test_model_card.py:107
Methodtest_width_cutoff_sits_at_32_characters
(self)
tests/util/test_dataset.py:465
Methodtest_with_exception_in_get_type_hints
Should return None when get_type_hints raises.
tests/base/modules/test_transformer.py:1848
Methodtest_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
Methodtest_with_no_return_annotation
Should return None when method has no return type annotation.
tests/base/modules/test_transformer.py:1840
Methodtest_with_save_dir_and_source_path
VideoDecoder with save_dir and source file produces <video> tag.
tests/base/test_model_card.py:1322
Methodtest_without_save_dir_returns_placeholder
Without save_dir, returns text placeholder in <code> tag.
tests/base/test_model_card.py:1361
Functiontest_word_embeddings_encode_empty_tokens_batch_invariance
(encoder, batch_size)
tests/sentence_transformer/modules/test_word_embeddings.py:152
Functiontest_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
Functiontest_word_embeddings_respects_max_seq_length
(prompt, expected_ids, expected_embeddings)
tests/sentence_transformer/modules/test_word_embeddings.py:110
Functiontest_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
Functiontest_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
Methodtest_works_on_methods
(self, caplog)
tests/util/test_decorators.py:76
Methodtest_wrong_id_type_reports_not_found
(self)
tests/util/test_dataset.py:534
Methodtest_wrong_tuple_length
(self, queries: Dataset)
tests/util/test_dataset.py:269
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_xtr_scoring_callable_shape
()
tests/multi_vector_encoder/test_model.py:1781
Functiontest_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
Methodtest_youtube_mobile
(self)
tests/base/test_modality.py:81
Methodtest_youtube_short
(self)
tests/base/test_modality.py:78
Methodtest_youtube_url_with_spaces_not_video
(self)
tests/base/test_modality.py:90
Methodtest_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
Methodtest_youtube_www
(self)
tests/base/test_modality.py:75
Functiontest_zero_cutoff
(documents: list[str])
tests/sparse_encoder/test_reciprocal_rank_fusion.py:141
Functiontest_zero_dimension_raises_error
Test that zero dimension in matryoshka_dims raises ValueError.
tests/sentence_transformer/losses/test_matryoshka.py:57
Functionto_binary_flickr8k
Converts the Flickr8k dataset format to a binary classification format
examples/sentence_transformer/training/clip/training_clip_flickr8k_mlflow.py:27
Functionto_ct_pairs
(sample, pos_neg_ratio=8)
examples/sentence_transformer/unsupervised_learning/CT/train_ct_from_file.py:75
Functionto_ct_pairs
(sample, pos_neg_ratio=8)
examples/sentence_transformer/unsupervised_learning/CT/train_stsb_ct.py:36
Functionto_ct_pairs
(sample, pos_neg_ratio=8)
examples/sentence_transformer/unsupervised_learning/CT/train_askubuntu_ct.py:49
Methodto_html_list
(data: dict)
sentence_transformers/base/model_card.py:1214
Methodto_yaml
(self, line_break=None)
sentence_transformers/base/model_card.py:2051
Functiontokenize
(batch)
examples/sentence_transformer/unsupervised_learning/MLM/train_mlm.py:46
Methodtokenize
(self, sentence: str)
sentence_transformers/sentence_transformer/modules/tokenizer/word.py:426
Methodtokenize
(self, text: str, **kwargs)
sentence_transformers/sentence_transformer/modules/tokenizer/phrase.py:63
Methodtokenize
(self, text: str, **kwargs)
sentence_transformers/sentence_transformer/modules/tokenizer/whitespace.py:32
Methodtokenize
(self, texts, **kwargs)
tests/base/modules/test_router.py:602
Methodtokenizer
The tokenizer, extracted from the processor. Returns ``None`` for non-text processors.
sentence_transformers/base/modules/transformer.py:1221
Methodtokenizer
(self)
sentence_transformers/base/modules/router.py:719
Functiontorch_embeddings
(model_dir: str)
tests/multi_vector_encoder/test_backends.py:42
Methodtransform
(batch)
tests/base/test_model_card.py:89
Functiontransformer_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
Functiontransformers_init
(*args, **kwargs)
tests/sentence_transformer/test_model.py:541
Methodtransformers_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
Functiontriplet_dataset
()
tests/multi_vector_encoder/test_trainer.py:26
Methodtruncate_sentence_embeddings
(self, truncate_dim: int | None)
sentence_transformers/sentence_transformer/model.py:1234
Methodtry_to_float
(metric_value)
sentence_transformers/base/model_card.py:1480
Methodtry_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
Methodtry_to_set_base_model
(self)
sentence_transformers/sentence_transformer/model_card.py:84
Functiontwo_label_dataset
100 samples, 2 labels with 50 samples each.
tests/base/samplers/test_group_by_label_batch_sampler.py:23
Functiontwo_rank_gather
(tensor: Tensor, mask: Tensor, with_grad: bool = False)
tests/multi_vector_encoder/losses/test_misc.py:571
Functionunavailable
(*args, **kwargs)
tests/test_kernels.py:887
Methodunpad_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
Functionupload_folder
(folder_path, **kwargs)
tests/backend/test_utils.py:129
Functionupper_transform
(batch)
tests/sentence_transformer/test_trainer.py:531
Functionupper_transform
(batch)
tests/sparse_encoder/test_trainer.py:234
Functionuse_kernel_forward_from_hub
(name)
sentence_transformers/util/kernels.py:19
Functionvarlen_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
Functionvisit_download_reference
(self, node)
docs/conf.py:178
Methodwarn_if_unsupported
(param: str, expected_value: bool, is_supported: bool, min_version: str)
sentence_transformers/base/modules/transformer.py:2335
Methodweight
(self)
sentence_transformers/sparse_encoder/modules/sparse_auto_encoder.py:26
Functionword_embeddings_model
(_word_embeddings_model: SentenceTransformer)
tests/conftest.py:168
Functionword_embeddings_model
()
tests/sentence_transformer/losses/test_embed_distill.py:259
Functionwrapper
(*args, **kwargs)
sentence_transformers/sentence_transformer/modules/pooling.py:55
Functionwrapper
(self, *args, **kwargs)
sentence_transformers/base/peft_mixin.py:12
Functionwrapper
(*args, **kwargs)
sentence_transformers/util/decorators.py:35
← previous4,501–4,575 of 4,575, ranked by callers