Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/huggingface/sentence-transformers
/ functions
Functions
3,759 in github.com/huggingface/sentence-transformers
⨍
Functions
3,759
◇
Types & classes
446
↳
Endpoints
48
Method
sort_metrics
(key: str)
sentence_transformers/base/model_card.py:1520
Function
sparse_tensors
Create two large sparse tensors of shape (50, 100) each.
tests/util/test_similarity.py:138
Function
splade_bert_tiny_model
(_splade_bert_tiny_model: SparseEncoder)
tests/conftest.py:161
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:1348
Function
spy
(**kwargs)
tests/sentence_transformer/losses/test_cached_gist_embed.py:268
Function
spy
(**kwargs)
tests/sentence_transformer/losses/test_mega_batch_margin.py:96
Function
spy
(**kwargs)
tests/sentence_transformer/losses/test_gradcache.py:87
Function
spy
(inputs, prompt=None, task=None, **kwargs)
tests/multi_vector_encoder/test_trainer.py:184
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:847
Function
spy_encode
(*args, **kwargs)
tests/sentence_transformer/test_model.py:1007
Function
spy_encode
(*args, **kwargs)
tests/sparse_encoder/test_model.py:266
Function
spy_forward
(*args, **kwargs)
tests/sparse_encoder/test_model.py:300
Method
start
(self)
examples/sentence_transformer/evaluation/evaluation_no_dup_batch_sampler_speed.py:329
Function
static_embedding_model
(static_embedding: StaticEmbedding)
tests/conftest.py:210
Function
static_retrieval_mrl_en_v1_model
(_static_retrieval_mrl_en_v1_model: SentenceTransformer)
tests/conftest.py:112
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:73
Function
stsb_bert_tiny_model_onnx
()
tests/conftest.py:91
Function
stsb_bert_tiny_model_openvino
()
tests/conftest.py:96
Function
stsb_dataset_dict
()
tests/conftest.py:217
Function
stub_qdrant_module
Qdrant is not a test dependency, so stand in for the imports that the function performs.
tests/sparse_encoder/test_search_engines.py:107
Function
stub_seismic_module
Seismic is not a test dependency, so stand in for the import that the function performs.
tests/sparse_encoder/test_search_engines.py:23
Method
temperature
(self)
sentence_transformers/sentence_transformer/losses/multiple_negatives_ranking.py:352
Method
temperature
(self)
sentence_transformers/sentence_transformer/losses/cached_multiple_negatives_ranking.py:394
Function
test_2d_labels_broadcast_across_columns
2D labels with multi-column input = same target broadcast (multilingual-distillation case).
tests/sentence_transformer/losses/test_embed_distill.py:57
Method
test_3d_bad_padding_side_raises
(self)
tests/multi_vector_encoder/test_token_pooling.py:422
Method
test_3d_bad_padding_side_raises_even_with_mask
(self)
tests/multi_vector_encoder/test_token_pooling.py:428
Method
test_3d_input_empty_batch
(self)
tests/multi_vector_encoder/test_token_pooling.py:414
Method
test_3d_input_left_padded_with_mask
(self)
tests/multi_vector_encoder/test_token_pooling.py:397
Method
test_3d_input_left_padding_round_trip
(self)
tests/multi_vector_encoder/test_token_pooling.py:45
Method
test_3d_input_returns_3d
(self)
tests/multi_vector_encoder/test_token_pooling.py:35
Function
test_3d_labels_column_count_mismatch_raises
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_embed_distill.py:82
Function
test_3d_labels_per_column
3D labels supply a different teacher embedding per text column.
tests/sentence_transformer/losses/test_embed_distill.py:69
Method
test_3d_unbind_preserves_middle_zero_row
(self)
tests/multi_vector_encoder/test_token_pooling.py:75
Method
test_4d_embedding_reshape
4D model outputs should be flattened to 3D.
tests/base/modules/test_transformer.py:607
Function
test_BinaryClassificationEvaluator_csv_columns_are_aligned
The results CSV data row must have as many columns as the header row. The ``*_accuracy_threshold`` and ``*_f1_threshold`` metrics contain a secon
tests/sentence_transformer/evaluation/test_binary_classification_evaluator.py:116
Function
test_BinaryClassificationEvaluator_distance_metrics_direction
The euclidean/manhattan metrics must treat smaller distances as more similar. ``pairwise_euclidean_sim``/``pairwise_manhattan_sim`` return negati
tests/sentence_transformer/evaluation/test_binary_classification_evaluator.py:50
Function
test_BinaryClassificationEvaluator_find_best_accuracy_and_threshold
Tests that the Acc score for the computed threshold is correct
tests/sentence_transformer/evaluation/test_binary_classification_evaluator.py:34
Function
test_BinaryClassificationEvaluator_find_best_f1_and_threshold
Tests that the F1 score for the computed threshold is correct
tests/sentence_transformer/evaluation/test_binary_classification_evaluator.py:17
Function
test_BinaryClassificationEvaluator_multiple_similarity_fn_names
Tests that the max_* aggregation does not assume that cosine was requested
tests/sentence_transformer/evaluation/test_binary_classification_evaluator.py:97
Function
test_LabelAccuracyEvaluator
Tests that the LabelAccuracyEvaluator can be loaded correctly
tests/sentence_transformer/evaluation/test_label_accuracy_evaluator.py:20
Function
test_ParaphraseMiningEvaluator
Tests that the ParaphraseMiningEvaluator can be loaded
tests/sentence_transformer/evaluation/test_paraphrase_mining_evaluator.py:13
Function
test_TripletEvaluator
Tests that the TripletEvaluator can be loaded & used
tests/sentence_transformer/evaluation/test_triplet_evaluator.py:13
Method
test_absent_keep_columns_ignored
(self, queries: Dataset)
tests/util/test_dataset.py:208
Function
test_adaptive_layer_disables_merging_for_the_dict_replay
AdaptiveLayerLoss deposits ``all_layer_embeddings`` in the per-column feature dicts on the final-layer pass and reads it back on every prior-layer
tests/sentence_transformer/losses/test_merged_forward.py:151
Function
test_adaptive_layer_loss_error_names_inner_stuck_point
For nested wrappers the error should name both the outer wrapper (what the user passed in) and the inner object the unwrap got stuck on.
tests/sentence_transformer/losses/test_adaptive_layer.py:159
Function
test_adaptive_layer_loss_invalid_layer_weighting
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_adaptive_layer.py:269
Function
test_adaptive_layer_loss_kl_teacher_is_detached
Regression test for #3757: the final-layer embeddings are the (teacher) target of the self-distillation KL loss and must be detached, so no gradie
tests/sentence_transformer/losses/test_adaptive_layer.py:170
Function
test_adaptive_layer_loss_layer_weighting
Each prior layer loss is scaled by the scheme's weight for its layer index, averaged over the number of sampled layers. KL is disabled so the tota
tests/sentence_transformer/losses/test_adaptive_layer.py:230
Function
test_adaptive_layer_loss_layer_weighting_in_config_dict
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_adaptive_layer.py:257
Function
test_adaptive_layer_loss_prior_layers_see_the_collated_mask
Each prior-layer pass re-runs the pooling half over the same feature dicts. If pooling wrote its prompt-excluded mask back into them, every pass a
tests/sentence_transformer/losses/test_adaptive_layer.py:61
Function
test_adaptive_layer_loss_raises_on_unrecognised_wrapper
If `self.model` is something we can't unwrap to a BaseModel, fail loudly instead of silently raising the cryptic `'X' object is not subscriptable`
tests/sentence_transformer/losses/test_adaptive_layer.py:148
Function
test_adaptive_layer_loss_runs_without_wrapper
Sanity check for the non-DDP, non-compile path: a bare SentenceTransformer skips the unwrap loop entirely.
tests/sentence_transformer/losses/test_adaptive_layer.py:84
Function
test_adaptive_layer_loss_unwraps_nested_wrappers
Compile-of-DDP and DDP-of-compile both need to unwrap to the inner BaseModel.
tests/sentence_transformer/losses/test_adaptive_layer.py:133
Function
test_adaptive_layer_loss_unwraps_wrapped_model
AdaptiveLayerLoss.forward reaches into `self.model[0]`. Under DDP / torch.compile the trainer rebinds `loss.model` to the wrapper (and binds BaseM
tests/sentence_transformer/losses/test_adaptive_layer.py:98
Function
test_adaptive_layer_warns_for_gradient_cached_losses
AdaptiveLayerLoss calls its base loss once per layer, which gradient caching cannot support. The ``uses_gradient_cache`` capability check must cat
tests/sentence_transformer/losses/test_gradcache.py:207
Method
test_all_deprecated_kwargs
Renames (sentences→inputs, activation_fct→activation_fn) are wired via deprecated_kwargs. num_workers is removed as a no-op.
tests/util/test_decorators.py:325
Method
test_all_fail_raises
When all strategies fail (no source path), RuntimeError is raised.
tests/base/test_model_card.py:1142
Method
test_allowlist_forward_filters_unknown_kwargs
When forward does not accept ``**kwargs`` (``model_forward_params`` is a set), forward() drops any feature key outside the allowlist.
tests/base/modules/test_transformer.py:902
Method
test_already_in_target_format
(self)
tests/base/test_modality.py:543
Method
test_ambiguous_frame_urls_can_be_wrapped
(self)
tests/base/test_modality.py:1016
Method
test_ambiguous_id_inference
(self)
tests/util/test_dataset.py:280
Method
test_ambiguous_value_inference
(self)
tests/util/test_dataset.py:290
Function
test_anchor_losses_keep_the_anchor_on_its_own_forward
Anchors (queries) are typically much narrower than the candidate columns, and merging them in would pad every anchor row to candidate width. Expec
tests/sentence_transformer/losses/test_merged_forward.py:99
Function
test_angle_loss_ranks_actual_angle_scores
(dummy_model, labels, score_difference)
tests/sentence_transformer/losses/test_cosent.py:41
Function
test_append_to_last_row
Only writes when there's a header plus at least one data row, and then appends every value to that row. Otherwise it no-ops and leaves the file un
tests/util/test_misc.py:171
Method
test_applies_pool_fn_per_sample
(self)
tests/multi_vector_encoder/test_token_pooling.py:163
Method
test_array_text_pair
(self)
tests/base/test_modality.py:1307
Method
test_array_text_pairs
Audio array + text pairs should be converted to message format.
tests/base/test_modality.py:1467
Method
test_asset_path_with_model_id
(self)
tests/base/test_model_card.py:186
Method
test_asset_path_without_model_id
(self)
tests/base/test_model_card.py:193
Method
test_asset_src_urls_rewritten
Training example table asset paths are rewritten to absolute Hub URLs.
tests/base/test_model_card.py:1432
Method
test_asset_url_with_model_id
(self)
tests/base/test_model_card.py:170
Method
test_asset_url_without_model_id
(self)
tests/base/test_model_card.py:176
Function
test_asym_import
(module_name: str)
tests/base/modules/test_router.py:354
Method
test_attribute_fallback_for_output
forward should fall back to getattr when dict indexing fails on model output.
tests/base/modules/test_transformer.py:633
Method
test_audio_collection_unwraps_each_recording
(self, container)
tests/base/test_modality.py:697
Method
test_audio_dict
(self)
tests/base/test_model_card.py:148
Method
test_audio_dict_column_stats
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/base/test_model_card.py:857
Method
test_audio_dict_placeholder
(self)
tests/base/test_model_card.py:236
Method
test_audio_dict_saved_as_wav
AudioDict saved to assets/ as .wav file.
tests/base/test_model_card.py:350
Method
test_audio_dict_unwraps_array_and_collects_sampling_rate
(self)
tests/base/test_modality.py:599
Method
test_audio_https_url
(self)
tests/base/test_modality.py:151
Method
test_audio_model_roundtrip
( self, tmp_path: Path, model_name: str, expected_class_name: str, extra_kwargs: dict )
tests/base/modules/test_transformer.py:1886
Method
test_audio_ndarray_inputs
(self)
tests/base/test_modality.py:586
Method
test_audio_url_detected_when_supported
(self)
tests/base/test_modality.py:326
Method
test_audio_url_falls_back_to_text_when_unsupported
(self)
tests/base/test_modality.py:305
Method
test_audio_url_with_spaces_not_audio
(self)
tests/base/test_modality.py:122
Method
test_auto_with_processor_infers_format
(self)
tests/base/test_modality.py:426
Method
test_auto_without_processor_defaults_to_structured
(self)
tests/base/test_modality.py:422
Function
test_backend_export
(backend, expected_auto_model_class, model_kwargs)
tests/sentence_transformer/test_backends.py:41
Function
test_backend_export
(backend, expected_auto_model_class, model_kwargs, model_dir, torch_embeddings)
tests/multi_vector_encoder/test_backends.py:74
Function
test_backend_export
(backend, expected_auto_model_class, model_kwargs)
tests/cross_encoder/test_backends.py:47
Function
test_backend_export
(backend, expected_auto_model_class, model_kwargs)
tests/sparse_encoder/test_backends.py:47
Function
test_backend_load
(backend, model_id, model_kwargs, exception)
tests/sentence_transformer/test_backends.py:89
Function
test_backend_load
(backend, model_id, model_kwargs, exception)
tests/cross_encoder/test_backends.py:95
Function
test_backend_load
(backend, model_id, model_kwargs, exception)
tests/sparse_encoder/test_backends.py:92
← previous
next →
1,901–2,000 of 3,759, ranked by callers