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_model_type_inherited_for_sentence_transformer_subclass
A subclass of SentenceTransformer should still report `model_type == "SentenceTransformer"`, so `_load_modules` takes the config path (not the con
tests/base/test_model_type_subclass.py:6
Function
test_model_type_inherited_for_sparse_encoder_subclass
Same inheritance and routing for SparseEncoder subclasses.
tests/base/test_model_type_subclass.py:25
Function
test_model_type_override_takes_precedence
A subclass that explicitly declares its own `model_type` opts out of the archetype identity, restoring the pre-#3536 conversion-path behavior on a
tests/base/test_model_type_subclass.py:59
Function
test_model_validates_all_paths_before_resolving_classes
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/base/test_model.py:2242
Function
test_module_configuration_error_details
(model)
tests/test_merging.py:262
Function
test_module_import
Test that functions can be accessed via the util module
tests/util/test_import.py:49
Method
test_module_output_name
Test that the module output name is 'causal_logits' for any-to-any.
tests/base/modules/transformer/test_any_to_any.py:124
Method
test_module_output_name
Test that the module output name is 'causal_logits' for text-generation.
tests/base/modules/transformer/test_text_generation.py:115
Method
test_module_output_name
Test that the module output name is 'scores' for sequence-classification.
tests/base/modules/transformer/test_sequence_classification.py:116
Method
test_module_output_name
Test that the module output name is 'token_embeddings' for fill-mask.
tests/base/modules/transformer/test_fill_mask.py:106
Function
test_modules_and_path_combo_warns_and_loads_from_path
Passing both ``model_name_or_path`` and ``modules`` silently discarded the modules: now it warns, and the checkpoint's own modules win.
tests/base/test_model.py:2036
Function
test_move_tensors_to_cpu_walks_every_shape_encode_can_return
()
tests/base/test_multi_process.py:108
Function
test_move_tensors_to_device_preserves_nested_outputs
(target_device)
tests/util/test_tensor.py:22
Function
test_mpnet_slow
(stsb_dataset_dict: DatasetDict)
tests/sentence_transformer/test_pretrained_stsb.py:90
Function
test_mse_equal_sentence_counts_preserve_score
(evaluator_cls, sentence_count, offset)
tests/sentence_transformer/evaluation/test_mse_evaluator.py:35
Function
test_mse_loss_matryoshka
Test MSELoss with multiple inputs (matryoshka).
tests/sentence_transformer/losses/test_matryoshka.py:192
Function
test_mse_loss_matryoshka_per_column_teacher
Per-column (3D) teacher embeddings are truncated like 2D ones instead of crashing.
tests/sentence_transformer/losses/test_matryoshka.py:206
Function
test_mse_rejects_unequal_sentence_counts
(evaluator_cls, source_count, target_count)
tests/sentence_transformer/evaluation/test_mse_evaluator.py:15
Function
test_mseloss_accepts_projection_dim
The upgraded MSELoss should accept a projection_dim for cross-dim distillation.
tests/sentence_transformer/losses/test_embed_distill.py:153
Function
test_mseloss_get_config_dict_exposes_projection_dim
MSELoss's config should expose `projection_dim` (the only knob it has) so model cards reflect cross-dim distillation runs.
tests/sentence_transformer/losses/test_embed_distill.py:162
Function
test_mseloss_is_subclass_of_embed_distill
()
tests/sentence_transformer/losses/test_embed_distill.py:149
Function
test_mseloss_save_load_projection
MSELoss should inherit `save_projection` / `load_projection` from the parent.
tests/sentence_transformer/losses/test_embed_distill.py:243
Function
test_mseloss_subclass_matches_embed_distill_mse
`MSELoss(model)` should produce the same value as `EmbedDistillLoss(model, distance_metric='mse')`.
tests/sentence_transformer/losses/test_embed_distill.py:135
Function
test_msmarco_slow
(stsb_dataset_dict: DatasetDict)
tests/sentence_transformer/test_pretrained_stsb.py:104
Function
test_multi_dataset_batch_sampler_propagates_epoch
(dummy_concat_dataset: ConcatDataset)
tests/base/samplers/test_round_robin_batch_sampler.py:171
Function
test_multi_objective_training_only_updates_active_loss
(loss_training_model, tmp_path, fp16: bool)
tests/base/test_trainer.py:490
Function
test_multi_process
Test use_multi_process parameter if multiple CPUs available.
tests/util/test_hard_negatives.py:1301
Function
test_multi_process_chunk_size
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:255
Function
test_multi_process_chunk_size
(reranker_bert_tiny_model: CrossEncoder)
tests/cross_encoder/test_multi_process.py:96
Function
test_multi_process_chunk_size
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_multi_process.py:80
Function
test_multi_process_default_token_pooling
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/test_multi_process.py:32
Function
test_multi_process_drains_results_after_failure
()
tests/base/test_multi_process.py:175
Function
test_multi_process_empty_inputs_skip_pool_creation
(monkeypatch)
tests/base/test_multi_process.py:206
Function
test_multi_process_encode_same_as_standard_encode
(inference_device: str)
tests/sentence_transformer/test_multi_process.py:126
Function
test_multi_process_encode_same_as_standard_encode
(model_fixture: str, request: pytest.FixtureRequest)
tests/sparse_encoder/test_multi_process.py:18
Function
test_multi_process_encoding_works_with_an_undispatched_device_map
``device_map="auto"`` on a model that fits leaves an ordinary model, which a pool can still use. ``transformers`` attaches no accelerate hooks in
tests/base/test_model.py:1084
Function
test_multi_process_int8_matches_single_process
int8/uint8 calibration ranges are computed from the batch: quantizing per worker chunk would give different buckets, so the pool path must quantiz
tests/sentence_transformer/test_multi_process.py:203
Function
test_multi_process_matches_single_process
( mve_bert_tiny_model: MultiVectorEncoder, truncate_dim: int | None, default_truncate_dim: int | None )
tests/multi_vector_encoder/test_multi_process.py:19
Function
test_multi_process_more_workers_than_pairs
(reranker_bert_tiny_model: CrossEncoder)
tests/cross_encoder/test_multi_process.py:174
Function
test_multi_process_more_workers_than_texts
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:385
Function
test_multi_process_more_workers_than_texts
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_multi_process.py:171
Function
test_multi_process_output_tensors_two_devices
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:415
Function
test_multi_process_output_tensors_two_devices
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/test_multi_process.py:68
Function
test_multi_process_output_tensors_two_devices
(reranker_bert_tiny_model: CrossEncoder)
tests/cross_encoder/test_multi_process.py:204
Function
test_multi_process_output_tensors_two_devices
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_multi_process.py:201
Function
test_multi_process_output_value_none
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/test_multi_process.py:47
Function
test_multi_process_output_values
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:226
Function
test_multi_process_pool
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:152
Function
test_multi_process_pool
(reranker_bert_tiny_model: CrossEncoder)
tests/cross_encoder/test_multi_process.py:69
Function
test_multi_process_pool
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_multi_process.py:29
Function
test_multi_process_pool_cleans_up_after_startup_failure
( monkeypatch, failed_worker, failure_stage, error_type )
tests/sentence_transformer/test_multi_process.py:21
Function
test_multi_process_pool_cleanup
(failure: str | None)
tests/util/test_hard_negatives.py:1328
Function
test_multi_process_pool_refuses_a_dispatched_model
accelerate's hooks cannot survive being moved to the CPU and forked into worker processes.
tests/base/test_model.py:1204
Function
test_multi_process_predict_same_as_standard_predict
(reranker_bert_tiny_model: CrossEncoder)
tests/cross_encoder/test_multi_process.py:49
Function
test_multi_process_raises_reported_worker_failure
()
tests/sentence_transformer/test_multi_process.py:78
Function
test_multi_process_raises_when_worker_died_without_reporting
()
tests/base/test_multi_process.py:190
Function
test_multi_process_rejects_invalid_chunk_size
(chunk_size)
tests/base/test_multi_process.py:200
Function
test_multi_process_restores_chunk_order
(output_kind)
tests/base/test_multi_process.py:154
Function
test_multi_process_with_args
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:175
Function
test_multi_process_with_args
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_multi_process.py:53
Function
test_multi_process_with_empty_pairs
( reranker_bert_tiny_model: CrossEncoder, convert_to_tensor: bool, convert_to_numpy: bool )
tests/cross_encoder/test_multi_process.py:116
Function
test_multi_process_with_empty_texts
( stsb_bert_tiny_model: SentenceTransformer, convert_to_tensor: bool, convert_to_numpy: bool,
tests/sentence_transformer/test_multi_process.py:302
Function
test_multi_process_with_empty_texts
( splade_bert_tiny_model: SparseEncoder, convert_to_tensor: bool, convert_to_sparse_tensor: bool )
tests/sparse_encoder/test_multi_process.py:97
Function
test_multi_process_with_large_chunk_size
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:398
Function
test_multi_process_with_large_chunk_size
(reranker_bert_tiny_model: CrossEncoder)
tests/cross_encoder/test_multi_process.py:187
Function
test_multi_process_with_large_chunk_size
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_multi_process.py:184
Function
test_multi_process_with_one_single_string
( stsb_bert_tiny_model: SentenceTransformer, convert_to_tensor: bool, convert_to_numpy: bool,
tests/sentence_transformer/test_multi_process.py:334
Function
test_multi_process_with_prompt
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_multi_process.py:269
Function
test_multi_process_with_single_pair
( reranker_bert_tiny_model: CrossEncoder, convert_to_tensor: bool, convert_to_numpy: bool )
tests/cross_encoder/test_multi_process.py:148
Function
test_multi_process_with_single_string
( splade_bert_tiny_model: SparseEncoder, convert_to_tensor: bool, convert_to_sparse_tensor: bool )
tests/sparse_encoder/test_multi_process.py:124
Function
test_multi_process_worker_reports_encode_failure
(unpicklable: bool)
tests/sentence_transformer/test_multi_process.py:51
Function
test_multi_process_worker_reports_inference_failure
(model_class, unpicklable: bool)
tests/base/test_multi_process.py:88
Function
test_multi_process_worker_returns_cpu_tensors
Results leave the worker through a queue, so nothing may still be on the accelerator. A device tensor crosses as a shared handle that is only rea
tests/base/test_multi_process.py:133
Method
test_multi_turn_messages
(self)
tests/base/modules/test_transformer.py:2434
Function
test_multi_vector_mask_respects_partial_expansion_positions
The scoring mask force-includes only the marked positions: a position that is neither a real token nor marked as expansion stays excluded (the old
tests/multi_vector_encoder/test_model.py:1218
Function
test_multiling_slow
(stsb_dataset_dict: DatasetDict)
tests/sentence_transformer/test_pretrained_stsb.py:82
Method
test_multimodal_batch_preserves_each_samples_key_order
(self, supported_modalities, collections)
tests/base/test_modality.py:776
Method
test_multimodal_dict
(self)
tests/base/test_model_card.py:183
Method
test_multimodal_dict_audio_only_wrapper_raw_array
A ``{"audio": array}`` wrapper with a raw array should behave like bare audio inputs.
tests/base/test_modality.py:802
Method
test_multimodal_dict_inputs
(self)
tests/base/test_modality.py:743
Method
test_multimodal_dict_inputs_preserves_key_ordering
Output dict key order should match the input dicts' key order, not the modality tuple.
tests/base/test_modality.py:753
Method
test_multimodal_dict_returns_sorted_tuple
(self)
tests/base/test_modality.py:215
Method
test_multimodal_dict_sorting_is_consistent
(self)
tests/base/test_modality.py:220
Method
test_multimodal_dict_unwraps_audio_alongside_text
Audio should unwrap even when combined with other modalities in the same dict.
tests/base/test_modality.py:846
Method
test_multimodal_dict_unwraps_audio_decoder
A ``{"audio": AudioDecoder}`` wrapper should unwrap the decoder into a raw array.
tests/base/test_modality.py:868
Method
test_multimodal_dict_unwraps_nested_audio_dict
A ``{"audio": {"array": ..., "sampling_rate": ...}}`` wrapper should unwrap the nested dict.
tests/base/test_modality.py:828
Method
test_multimodal_dict_unwraps_nested_video_dict
A ``{"video": {"array": ..., "video_metadata": ...}}`` wrapper should unwrap the nested dict.
tests/base/test_modality.py:837
Method
test_multimodal_dict_unwraps_video_alongside_text
Video metadata should survive alongside other modalities, as the #3864 error message advises.
tests/base/test_modality.py:857
Method
test_multimodal_dict_unwraps_video_decoder
A ``{"video": VideoDecoder}`` wrapper should unwrap the decoder and collect metadata.
tests/base/test_modality.py:891
Method
test_multimodal_dict_with_text_and_image
Multimodal dict: text kept as-is, image saved to file.
tests/base/test_model_card.py:347
Method
test_multimodal_messages_skip_flattening
Messages with non-text content should NOT be flattened even when can_flatten_inputs is True.
tests/base/modules/test_transformer.py:2333
Function
test_multimodal_smoke_image_document_through_mve
Image-document path through the default MVE module sequence with a tiny PaliGemma backbone. The real ColPali checkpoint (``vidore/colpali-v1.3-me
tests/multi_vector_encoder/test_model.py:1800
Function
test_multiple_adapters
( stsb_bert_tiny_model: SentenceTransformer, word_embeddings_model: SentenceTransformer )
tests/sentence_transformer/test_model.py:920
Method
test_multiple_images_indexed_correctly
Multiple distinct images get sequential indices.
tests/base/test_model_card.py:311
Method
test_multiple_images_per_sample
(self)
tests/base/modules/test_transformer.py:2389
Function
test_multiple_labels_per_row_raise
(loss_class, num_columns, labels, batch_size, labels_per_row)
tests/sentence_transformer/losses/test_misc.py:69
Function
test_multiple_labels_per_row_raise
( reranker_bert_tiny_model_v54: CrossEncoder, loss_class, batch_size, labels_per_row )
tests/cross_encoder/losses/test_misc.py:327
Method
test_multiple_message_lists
(self)
tests/base/test_modality.py:1212
Function
test_multiple_positives
( request: pytest.FixtureRequest, static_retrieval_mrl_en_v1_model: SentenceTransformer, output_fo
tests/util/test_hard_negatives.py:1802
Function
test_multiple_positives_per_query
Test dataset with multiple positives per query.
tests/util/test_hard_negatives.py:1032
← previous
next →
3,401–3,500 of 4,575, ranked by callers