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
Function
test_incorrect_backend
()
tests/cross_encoder/test_backends.py:142
Function
test_incorrect_backend
()
tests/sparse_encoder/test_backends.py:139
Function
test_incorrect_string_arguments
(argument_name)
tests/sentence_transformer/test_training_args.py:89
Function
test_infer_flatten_position_offset
RoBERTa-family embeddings compute positions starting at padding_idx + 1, so flattened inputs need their collator-produced 0-based position_ids shi
tests/base/modules/test_transformer.py:48
Method
test_infer_modalities_edge_cases_returns_none_for_unknown
Should return None for model types not in _EDGE_CASE_MODALITY_CONFIGS.
tests/base/modules/test_transformer.py:1815
Method
test_infer_modalities_from_processor_text
Should identify 'text' modality for a tokenizer-based processor.
tests/base/modules/test_transformer.py:1821
Function
test_inference_free_splade
(inference_free_splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_model.py:223
Function
test_inference_free_splade_max_active_dims_routing
(inference_free_splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_model.py:250
Method
test_inference_with_supported_modalities
Test inference with each supported modality (single and multi-modal).
tests/base/modules/transformer/test_any_to_any.py:129
Method
test_inference_with_supported_modalities
Test inference with each supported modality (single and multi-modal).
tests/base/modules/transformer/test_text_generation.py:120
Method
test_inference_with_supported_modalities
Test inference with each supported modality (single and multi-modal).
tests/base/modules/transformer/test_sequence_classification.py:121
Method
test_inference_with_supported_modalities
Test inference with each supported modality.
tests/base/modules/transformer/test_fill_mask.py:111
Method
test_inference_with_supported_modalities
Test inference with each supported modality (single and multi-modal).
tests/base/modules/transformer/test_feature_extraction.py:179
Method
test_inference_with_supported_modality_pairs
Test inference with pair inputs for each supported modality combination.
tests/base/modules/transformer/test_any_to_any.py:192
Method
test_inference_with_supported_modality_pairs
Test inference with pair inputs for each supported modality combination.
tests/base/modules/transformer/test_text_generation.py:183
Method
test_inference_with_supported_modality_pairs
Test inference with pair inputs for each supported modality combination.
tests/base/modules/transformer/test_sequence_classification.py:187
Function
test_information_retrieval_evaluator
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:23
Function
test_information_retrieval_evaluator_rejects_xtr_scoring
XTR's global top-k is incompatible with the evaluator's per-chunk corpus scoring, so an XTR scorer in ``score_functions`` must raise at constructi
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:47
Function
test_init_args_decorator
( monkeypatch: pytest.MonkeyPatch, in_args: tuple, in_kwargs: dict, out_args: tuple, out_kwargs: dict )
tests/cross_encoder/test_model.py:678
Function
test_init_does_not_mutate_kwargs
(reranker_bert_tiny_model: CrossEncoder, tmp_path: Path)
tests/cross_encoder/test_model.py:70
Function
test_init_token_pooling_defaults_and_overrides
(mve_bert_tiny_model, method: str, output: str)
tests/multi_vector_encoder/test_model.py:1600
Function
test_init_token_pooling_does_not_change_forward
(mve_bert_tiny_model)
tests/multi_vector_encoder/test_model.py:1629
Function
test_init_token_pooling_is_not_saved
(mve_bert_tiny_model, tmp_path, pooler: str)
tests/multi_vector_encoder/test_model.py:1649
Function
test_init_truncate_dim
(mve_bert_tiny_model: MultiVectorEncoder, method: str, output: str)
tests/multi_vector_encoder/test_model.py:1547
Function
test_init_truncate_dim_save_load
(mve_bert_tiny_model: MultiVectorEncoder, tmp_path)
tests/multi_vector_encoder/test_model.py:1573
Function
test_initialization_with_embedding_dim
(tokenizer: Tokenizer)
tests/sentence_transformer/modules/test_static_embedding.py:33
Function
test_initialization_with_embedding_weights
(tokenizer: Tokenizer, embedding_weights)
tests/sentence_transformer/modules/test_static_embedding.py:28
Function
test_input_precision_and_output_cast
(model)
tests/test_merging.py:167
Method
test_int_column_stats
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/base/test_model_card.py:872
Method
test_int_ids_resolve_end_to_end
(self)
tests/util/test_dataset.py:492
Method
test_integer_ids
(self)
tests/util/test_dataset.py:70
Function
test_intersection
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_model.py:458
Function
test_invalid_arguments
(model, kwargs, exception)
tests/test_merging.py:385
Method
test_invalid_backend_error
(self)
tests/base/modules/test_transformer.py:1763
Function
test_invalid_base_and_arity
(model)
tests/test_merging.py:390
Method
test_invalid_budget
(self, target: float)
tests/multi_vector_encoder/modules/test_token_pooling.py:496
Method
test_invalid_config_selection
(self, selection)
tests/cross_encoder/test_model.py:1398
Function
test_invalid_distance_metric_raises
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_embed_distill.py:18
Method
test_invalid_message_skipped
(self)
tests/base/test_modality.py:550
Method
test_invalid_modality_config_missing_method
(self)
tests/base/modules/test_transformer.py:524
Method
test_invalid_modality_config_missing_output_name
(self)
tests/base/modules/test_transformer.py:532
Method
test_invalid_output_format_rejected
(self, documents: Dataset)
tests/util/test_dataset.py:305
Method
test_invalid_threshold
(self, threshold: float)
tests/multi_vector_encoder/modules/test_token_pooling.py:486
Method
test_invalid_transformer_task
(self)
tests/base/modules/test_transformer.py:116
Function
test_io_nameless_dense_config_defaults_to_token_level
Dense configs that predate module IO names (PyLate / pre-v5.4 ST saves) load token-level via ``_get_module_init_defaults``, keyed on the saved con
tests/multi_vector_encoder/test_model.py:867
Method
test_ir_cross_column_deduplicates_documents
IR model should deduplicate documents from the second column.
tests/sentence_transformer/test_model_card.py:303
Method
test_ir_cross_column_sourcing
IR model should source query from first column and documents from second column.
tests/sentence_transformer/test_model_card.py:275
Method
test_ir_default_examples
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_model_card.py:209
Function
test_ir_evaluator_chunk_elements_reaches_scoring
The budget is bound onto the model-resolved scorer and actually invoked: a one-document-per- chunk budget must score identically to the default.
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:95
Function
test_ir_evaluator_defers_scoring_resolution_to_call_time
Default scoring resolves from the evaluated model's ``similarity_fn_name`` inside ``__call__``, not eagerly at init: a model carrying a different
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:70
Function
test_ir_evaluator_rejects_chunk_elements_with_score_functions
chunk_elements only configures the default model-resolved scoring, so pairing it with score_functions raises instead of being silently ignored.
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:167
Function
test_ir_evaluator_rejects_compiled_xtr_scoring
The XTR rejection must not be evaded by torch.compile, which the XTR docstring itself recommends for the hot path.
tests/multi_vector_encoder/test_model.py:1151
Method
test_ir_evaluator_sets_ir_model
(self, evaluator_factory)
tests/base/test_model_card.py:1577
Function
test_ir_evaluator_token_pooling_matches_pipeline_pooling
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:192
Function
test_ir_evaluator_truncate_dim_matches_manual_truncation
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:224
Function
test_ir_evaluator_warns_when_explicit_prompt_replaces_model_prompt
An explicit query_prompt replaces the model's registered marker prompt instead of composing with it, so the evaluator warns once.
tests/multi_vector_encoder/evaluation/test_information_retrieval.py:113
Method
test_ir_snippet_shapes
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_model_card.py:218
Method
test_ir_snippet_structure
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_model_card.py:194
Method
test_ir_with_similarities
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_model_card.py:229
Function
test_is_dist_initialized_returns_false_when_distributed_unavailable
(monkeypatch: pytest.MonkeyPatch)
tests/util/test_environment.py:32
Function
test_is_singular_input_conversation
A bare conversation (list of role/content message dicts) is one input, not a batch.
tests/base/test_model.py:1817
Function
test_is_singular_input_conversation_batch
A list of conversations is a batch, and non-message dicts do not trigger the conversation rule.
tests/base/test_model.py:1827
Function
test_is_singular_input_list
A list input should be a batch (not singular).
tests/base/test_model.py:1807
Function
test_is_singular_input_numpy
A numeric numpy array should be singular (treated as an audio waveform).
tests/base/test_model.py:1835
Function
test_is_singular_input_numpy_0d_string
A 0-dim numpy string array represents a single text.
tests/base/test_model.py:1867
Function
test_is_singular_input_numpy_1d_pair
A 1D numpy string array represents a single (query, document) pair.
tests/cross_encoder/test_model.py:284
Function
test_is_singular_input_numpy_1d_strings
A 1D numpy string array is a batch of texts (e.g. from np.unique), not a single audio input.
tests/base/test_model.py:1845
Function
test_is_singular_input_numpy_2d_pairs
A 2D numpy string array is a batch of pairs.
tests/cross_encoder/test_model.py:289
Function
test_is_singular_input_numpy_2d_strings
A 2D numpy string array is a batch of text pairs.
tests/base/test_model.py:1851
Function
test_is_singular_input_numpy_bytes
A numpy byte-string array is not treated as a text batch (downstream modality inference does not handle Python ``bytes``), so it falls through to
tests/base/test_model.py:1856
Function
test_is_singular_input_numpy_empty
An empty 1D string ndarray is an empty batch, not a singular pair, matching ``predict([])``.
tests/cross_encoder/test_model.py:294
Function
test_is_singular_input_numpy_object
A numpy object array is a batch (no valid single-sample type is an object ndarray).
tests/base/test_model.py:1862
Function
test_is_singular_input_string
A string input should be singular.
tests/base/test_model.py:1802
Function
test_is_singular_input_tensor
A torch tensor should be singular (not a list type).
tests/base/test_model.py:1840
Function
test_is_singular_input_tuple
A tuple input should be a batch (not singular).
tests/base/test_model.py:1812
Function
test_jina_clip
()
tests/sentence_transformer/test_custom_models.py:75
Function
test_jina_embeddings_v3
()
tests/sentence_transformer/test_custom_models.py:60
Method
test_kd_shape_explodes_lists_into_numbered_columns
(self, queries: Dataset, documents: Dataset)
tests/util/test_dataset.py:25
Method
test_kd_shape_with_string_encoded_ids_and_scores
(self, queries: Dataset, documents: Dataset)
tests/util/test_dataset.py:128
Method
test_kept_column_collision_raises
(self, documents: Dataset)
tests/util/test_dataset.py:357
Method
test_known_model_type
(self, model_type)
tests/base/test_modality.py:436
Method
test_kwargs_forward_excludes_bookkeeping_keys
When forward accepts ``**kwargs`` (``model_forward_params is None``), forward() passes the real model inputs but drops ST bookkeeping and toke
tests/base/modules/test_transformer.py:1010
Method
test_kwargs_forward_keeps_bookkeeping_keys_the_model_declares
A custom model whose forward names a bookkeeping key wants it (e.g. task adapters keyed on ``task``), so the denylist must yield to an explici
tests/base/modules/test_transformer.py:1060
Method
test_label_column_extracted
(self)
tests/base/test_data_collator.py:41
Function
test_labeled_list_output_scores_match_similarity
Verify that labeled-list scores match recomputed query-passage similarity for all items. Runs over both the single- and multiple-positive dataset
tests/util/test_hard_negatives.py:859
Function
test_labeled_pair_output_scores_match_similarity
Verify that labeled-pair scores match recomputed query-passage similarity. Runs over both the single- and multiple-positive datasets.
tests/util/test_hard_negatives.py:825
Method
test_lambda_pooling_with_lambda_does_not_pickle
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:320
Method
test_lambda_pooling_with_top_level_func_pickles
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:312
Method
test_large_model_roundtrip
( self, tmp_path: Path, model_name: str, expected_class_name: str, extra_kwargs: dict )
tests/base/modules/test_transformer.py:2184
Function
test_larger_dataset_with_combinations
Test with a larger dataset and challenging parameter combinations.
tests/util/test_hard_negatives.py:1529
Method
test_left_pad_middle_zero_preserved_no_mask
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:668
Function
test_legacy_mlm_transformer
(splade_bert_tiny_model, tmp_path, legacy_first, method)
tests/test_merging.py:452
Function
test_legacy_model_module_paths
(tmp_path: Path, external: bool)
tests/base/test_model.py:2257
Function
test_legacy_router_module_paths
(tmp_path: Path, external: bool)
tests/base/modules/test_router.py:1593
Function
test_len_matches_iteration
(balanced_dataset: Dataset)
tests/base/samplers/test_group_by_label_batch_sampler.py:86
Function
test_len_matches_iteration_remainder_of_two
When stream_length % batch_size == 2, __len__ and __iter__ must agree. 2 labels with 6 and 4 samples -> stream_length=8, batch_size=6 -> remainde
tests/base/samplers/test_group_by_label_batch_sampler.py:95
Function
test_linear_merge_and_roundtrip
(model, tmp_path)
tests/test_merging.py:40
Method
test_list_column_all_same_length
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/base/test_model_card.py:901
Method
test_list_column_varying_lengths
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/base/test_model_card.py:910
Method
test_list_input_returns_list
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:57
← previous
next →
3,001–3,100 of 4,575, ranked by callers