MCPcopy Create free account

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

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

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:114
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:59
Methodtest_3d_bad_padding_side_raises
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:653
Methodtest_3d_bad_padding_side_raises_even_with_mask
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:659
Methodtest_3d_input_empty_batch
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:645
Methodtest_3d_input_left_padded_with_mask
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:628
Methodtest_3d_input_left_padding_round_trip
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:74
Methodtest_3d_input_returns_3d
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:64
Functiontest_3d_labels_column_count_mismatch_raises
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_embed_distill.py:84
Functiontest_3d_labels_per_column
3D labels supply a different teacher embedding per text column.
tests/sentence_transformer/losses/test_embed_distill.py:71
Methodtest_3d_unbind_preserves_middle_zero_row
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:104
Methodtest_4d_embedding_reshape
4D model outputs should be flattened to 3D.
tests/base/modules/test_transformer.py:798
Functiontest_BinaryClassificationEvaluator_best_threshold_matches_predictions
( high_score_more_similar, scores, labels, expected_accuracy, expected_f1 )
tests/sentence_transformer/evaluation/test_binary_classification_evaluator.py:72
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:163
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:97
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:144
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:20
Functiontest_ParaphraseMiningEvaluator_uses_model_similarity
Candidate pairs are scored with the model's similarity function, not always cosine.
tests/sentence_transformer/evaluation/test_paraphrase_mining_evaluator.py:115
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:209
Methodtest_accelerate_hook_preserves_custom_forward_rejection
(self)
tests/cross_encoder/test_model.py:1468
Methodtest_accelerate_hooks
(self, offload, selected_before_dispatch)
tests/cross_encoder/test_model.py:1433
Functiontest_accepts_a_tokenizer_without_a_vocab_attribute
(loss_class)
tests/sentence_transformer/losses/test_cached_gist_embed.py:51
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:225
Functiontest_add_transitive_closure_flag_still_expands_duplicates
Passing ``add_transitive_closure=True`` must still apply the transitive closure to the duplicates.
tests/sentence_transformer/evaluation/test_paraphrase_mining_evaluator.py:50
Functiontest_add_transitive_closure_ignores_non_duplicate_pairs
(non_duplicate_id: str)
tests/sentence_transformer/evaluation/test_paraphrase_mining_evaluator.py:65
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:376
Methodtest_all_fail_raises
When all strategies fail (no source path), RuntimeError is raised.
tests/base/test_model_card.py:1206
Functiontest_all_models_configure_existing_backbones
(monkeypatch, model_class, selection)
tests/test_kernels.py:736
Functiontest_all_models_enable_loaded_backbone_defaults
(loader, model_class)
tests/test_kernels.py:771
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:1093
Methodtest_already_in_target_format
(self)
tests/base/test_modality.py:544
Methodtest_ambiguous_frame_urls_can_be_wrapped
(self)
tests/base/test_modality.py:1017
Methodtest_ambiguous_id_inference
(self)
tests/util/test_dataset.py:281
Methodtest_ambiguous_value_inference
(self)
tests/util/test_dataset.py:291
Functiontest_anchor_exclusion_preserves_candidate_window
( use_faiss: bool, output_format: str, sampling_strategy: str )
tests/util/test_hard_negatives.py:2081
Functiontest_anchor_is_not_mined_as_its_own_negative
( positives: list[str], include_positives: bool, expected_negatives: list[str] )
tests/util/test_hard_negatives.py:2060
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:43
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:219
Methodtest_applies_pool_fn_per_sample
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:282
Methodtest_array_text_pair
(self)
tests/base/test_modality.py:1308
Methodtest_array_text_pairs
Audio array + text pairs should be converted to message format.
tests/base/test_modality.py:1468
Methodtest_asset_path_with_model_id
(self)
tests/base/test_model_card.py:212
Methodtest_asset_path_without_model_id
(self)
tests/base/test_model_card.py:219
Methodtest_asset_src_urls_rewritten
Training example table asset paths are rewritten to absolute Hub URLs.
tests/base/test_model_card.py:1496
Methodtest_asset_url_with_model_id
(self)
tests/base/test_model_card.py:196
Methodtest_asset_url_without_model_id
(self)
tests/base/test_model_card.py:202
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:824
Methodtest_audio_collection_unwraps_each_recording
(self, container)
tests/base/test_modality.py:698
Methodtest_audio_dict
(self)
tests/base/test_model_card.py:174
Methodtest_audio_dict_column_stats
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/base/test_model_card.py:921
Methodtest_audio_dict_placeholder
(self)
tests/base/test_model_card.py:262
Methodtest_audio_dict_saved_as_wav
AudioDict saved to assets/ as .wav file.
tests/base/test_model_card.py:376
Methodtest_audio_dict_unwraps_array_and_collects_sampling_rate
(self)
tests/base/test_modality.py:600
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:2156
Methodtest_audio_ndarray_inputs
(self)
tests/base/test_modality.py:587
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_autograd_mode_selects_inference_only_provider
(loader, embeddings)
tests/test_kernels.py:392
Functiontest_backbone_settings_pass_through_model_kwargs
(loader, monkeypatch, embeddings, model_class)
tests/test_kernels.py:693
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_listing_uses_resolved_revision
(monkeypatch: pytest.MonkeyPatch)
tests/util/test_backend.py:12
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
Functiontest_backend_no_export_crash
()
tests/sentence_transformer/test_backends.py:53
Functiontest_backend_no_export_crash
()
tests/cross_encoder/test_backends.py:59
Functiontest_backend_no_export_crash
()
tests/sparse_encoder/test_backends.py:56
Functiontest_backend_save_and_load
(backend, model_dir, torch_embeddings, tmp_path)
tests/multi_vector_encoder/test_backends.py:83
Methodtest_bad_input_type_raises
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:99
Functiontest_bare_checkpoint_gets_no_expansion
()
tests/multi_vector_encoder/test_model.py:56
Methodtest_bare_subclass_raises_not_implemented
(self)
tests/base/modules/test_input_module.py:73
Methodtest_base_forward_via_lambda_pooling_variable_length
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:608
Methodtest_base_hook_returns_router_mapping_entry
(self)
tests/base/test_data_collator.py:228
← previousnext →2,201–2,300 of 4,575, ranked by callers