MCPcopy Create free account

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

Functions3,759 in github.com/huggingface/sentence-transformers

Methodsort_metrics
(key: str)
sentence_transformers/base/model_card.py:1520
Functionsparse_tensors
Create two large sparse tensors of shape (50, 100) each.
tests/util/test_similarity.py:138
Functionsplade_bert_tiny_model
(_splade_bert_tiny_model: SparseEncoder)
tests/conftest.py:161
Methodsplade_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
Functionspy
(**kwargs)
tests/sentence_transformer/losses/test_cached_gist_embed.py:268
Functionspy
(**kwargs)
tests/sentence_transformer/losses/test_mega_batch_margin.py:96
Functionspy
(**kwargs)
tests/sentence_transformer/losses/test_gradcache.py:87
Functionspy
(inputs, prompt=None, task=None, **kwargs)
tests/multi_vector_encoder/test_trainer.py:184
Functionspy
(**kwargs)
tests/cross_encoder/losses/test_cached_multiple_negatives_ranking.py:76
Functionspy
(**kwargs)
tests/sparse_encoder/losses/test_cached_splade.py:262
Functionspy
(**kwargs)
tests/base/modules/test_router.py:296
Methodspy
(**kwargs)
tests/base/modules/test_transformer.py:847
Functionspy_encode
(*args, **kwargs)
tests/sentence_transformer/test_model.py:1007
Functionspy_encode
(*args, **kwargs)
tests/sparse_encoder/test_model.py:266
Functionspy_forward
(*args, **kwargs)
tests/sparse_encoder/test_model.py:300
Methodstart
(self)
examples/sentence_transformer/evaluation/evaluation_no_dup_batch_sampler_speed.py:329
Functionstatic_embedding_model
(static_embedding: StaticEmbedding)
tests/conftest.py:210
Functionstatic_retrieval_mrl_en_v1_model
(_static_retrieval_mrl_en_v1_model: SentenceTransformer)
tests/conftest.py:112
Methodstop
(self)
examples/sentence_transformer/evaluation/evaluation_no_dup_batch_sampler_speed.py:335
Functionstsb_bert_tiny_model
(_stsb_bert_tiny_model: SentenceTransformer)
tests/conftest.py:73
Functionstsb_bert_tiny_model_onnx
()
tests/conftest.py:91
Functionstsb_bert_tiny_model_openvino
()
tests/conftest.py:96
Functionstsb_dataset_dict
()
tests/conftest.py:217
Functionstub_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
Functionstub_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
Methodtemperature
(self)
sentence_transformers/sentence_transformer/losses/multiple_negatives_ranking.py:352
Methodtemperature
(self)
sentence_transformers/sentence_transformer/losses/cached_multiple_negatives_ranking.py:394
Functiontest_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
Methodtest_3d_bad_padding_side_raises
(self)
tests/multi_vector_encoder/test_token_pooling.py:422
Methodtest_3d_bad_padding_side_raises_even_with_mask
(self)
tests/multi_vector_encoder/test_token_pooling.py:428
Methodtest_3d_input_empty_batch
(self)
tests/multi_vector_encoder/test_token_pooling.py:414
Methodtest_3d_input_left_padded_with_mask
(self)
tests/multi_vector_encoder/test_token_pooling.py:397
Methodtest_3d_input_left_padding_round_trip
(self)
tests/multi_vector_encoder/test_token_pooling.py:45
Methodtest_3d_input_returns_3d
(self)
tests/multi_vector_encoder/test_token_pooling.py:35
Functiontest_3d_labels_column_count_mismatch_raises
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_embed_distill.py:82
Functiontest_3d_labels_per_column
3D labels supply a different teacher embedding per text column.
tests/sentence_transformer/losses/test_embed_distill.py:69
Methodtest_3d_unbind_preserves_middle_zero_row
(self)
tests/multi_vector_encoder/test_token_pooling.py:75
Methodtest_4d_embedding_reshape
4D model outputs should be flattened to 3D.
tests/base/modules/test_transformer.py:607
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_LabelAccuracyEvaluator
Tests that the LabelAccuracyEvaluator can be loaded correctly
tests/sentence_transformer/evaluation/test_label_accuracy_evaluator.py:20
Functiontest_ParaphraseMiningEvaluator
Tests that the ParaphraseMiningEvaluator can be loaded
tests/sentence_transformer/evaluation/test_paraphrase_mining_evaluator.py:13
Functiontest_TripletEvaluator
Tests that the TripletEvaluator can be loaded & used
tests/sentence_transformer/evaluation/test_triplet_evaluator.py:13
Methodtest_absent_keep_columns_ignored
(self, queries: Dataset)
tests/util/test_dataset.py:208
Functiontest_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
Functiontest_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
Functiontest_adaptive_layer_loss_invalid_layer_weighting
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_adaptive_layer.py:269
Functiontest_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
Functiontest_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
Functiontest_adaptive_layer_loss_layer_weighting_in_config_dict
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_adaptive_layer.py:257
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_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
Methodtest_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
Methodtest_all_fail_raises
When all strategies fail (no source path), RuntimeError is raised.
tests/base/test_model_card.py:1142
Methodtest_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
Methodtest_already_in_target_format
(self)
tests/base/test_modality.py:543
Methodtest_ambiguous_frame_urls_can_be_wrapped
(self)
tests/base/test_modality.py:1016
Methodtest_ambiguous_id_inference
(self)
tests/util/test_dataset.py:280
Methodtest_ambiguous_value_inference
(self)
tests/util/test_dataset.py:290
Functiontest_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
Functiontest_angle_loss_ranks_actual_angle_scores
(dummy_model, labels, score_difference)
tests/sentence_transformer/losses/test_cosent.py:41
Functiontest_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
Methodtest_applies_pool_fn_per_sample
(self)
tests/multi_vector_encoder/test_token_pooling.py:163
Methodtest_array_text_pair
(self)
tests/base/test_modality.py:1307
Methodtest_array_text_pairs
Audio array + text pairs should be converted to message format.
tests/base/test_modality.py:1467
Methodtest_asset_path_with_model_id
(self)
tests/base/test_model_card.py:186
Methodtest_asset_path_without_model_id
(self)
tests/base/test_model_card.py:193
Methodtest_asset_src_urls_rewritten
Training example table asset paths are rewritten to absolute Hub URLs.
tests/base/test_model_card.py:1432
Methodtest_asset_url_with_model_id
(self)
tests/base/test_model_card.py:170
Methodtest_asset_url_without_model_id
(self)
tests/base/test_model_card.py:176
Functiontest_asym_import
(module_name: str)
tests/base/modules/test_router.py:354
Methodtest_attribute_fallback_for_output
forward should fall back to getattr when dict indexing fails on model output.
tests/base/modules/test_transformer.py:633
Methodtest_audio_collection_unwraps_each_recording
(self, container)
tests/base/test_modality.py:697
Methodtest_audio_dict
(self)
tests/base/test_model_card.py:148
Methodtest_audio_dict_column_stats
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/base/test_model_card.py:857
Methodtest_audio_dict_placeholder
(self)
tests/base/test_model_card.py:236
Methodtest_audio_dict_saved_as_wav
AudioDict saved to assets/ as .wav file.
tests/base/test_model_card.py:350
Methodtest_audio_dict_unwraps_array_and_collects_sampling_rate
(self)
tests/base/test_modality.py:599
Methodtest_audio_https_url
(self)
tests/base/test_modality.py:151
Methodtest_audio_model_roundtrip
( self, tmp_path: Path, model_name: str, expected_class_name: str, extra_kwargs: dict )
tests/base/modules/test_transformer.py:1886
Methodtest_audio_ndarray_inputs
(self)
tests/base/test_modality.py:586
Methodtest_audio_url_detected_when_supported
(self)
tests/base/test_modality.py:326
Methodtest_audio_url_falls_back_to_text_when_unsupported
(self)
tests/base/test_modality.py:305
Methodtest_audio_url_with_spaces_not_audio
(self)
tests/base/test_modality.py:122
Methodtest_auto_with_processor_infers_format
(self)
tests/base/test_modality.py:426
Methodtest_auto_without_processor_defaults_to_structured
(self)
tests/base/test_modality.py:422
Functiontest_backend_export
(backend, expected_auto_model_class, model_kwargs)
tests/sentence_transformer/test_backends.py:41
Functiontest_backend_export
(backend, expected_auto_model_class, model_kwargs, model_dir, torch_embeddings)
tests/multi_vector_encoder/test_backends.py:74
Functiontest_backend_export
(backend, expected_auto_model_class, model_kwargs)
tests/cross_encoder/test_backends.py:47
Functiontest_backend_export
(backend, expected_auto_model_class, model_kwargs)
tests/sparse_encoder/test_backends.py:47
Functiontest_backend_load
(backend, model_id, model_kwargs, exception)
tests/sentence_transformer/test_backends.py:89
Functiontest_backend_load
(backend, model_id, model_kwargs, exception)
tests/cross_encoder/test_backends.py:95
Functiontest_backend_load
(backend, model_id, model_kwargs, exception)
tests/sparse_encoder/test_backends.py:92
← previousnext →1,901–2,000 of 3,759, ranked by callers