MCPcopy Create free account

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

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

Methodtest_multiple_renames
(self, caplog)
tests/util/test_decorators.py:59
Methodtest_multiple_text_messages
Multi-turn text-only conversations are text-only.
tests/base/test_modality.py:1559
Methodtest_multiple_videos_and_frame_list_preserve_sample_boundaries
( self, container, frame_container, wrapped_frames, paired )
tests/base/test_modality.py:1051
Functiontest_n_tuple_output_scores_match_similarity
Verify that n-tuple scores match recomputed query-positive/negatives similarity. Runs over both the single- and multiple-positive datasets.
tests/util/test_hard_negatives.py:734
Functiontest_n_tuple_scores_alias_output_scores_match_similarity
Verify that n-tuple-scores (deprecated alias) exposes correct similarity scores. Runs over both the single- and multiple-positive datasets.
tests/util/test_hard_negatives.py:781
Functiontest_n_tuple_scores_format_details
Test details of n-tuple-scores output format.
tests/util/test_hard_negatives.py:1607
Functiontest_nano_beir_evaluator_emits_lowercase_maxsim_key
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/evaluation/test_nano_beir.py:10
Functiontest_nano_beir_evaluator_token_pooling_and_truncate_dim_naming
(monkeypatch)
tests/multi_vector_encoder/evaluation/test_nano_beir.py:36
Functiontest_nanobeir_evaluator
Tests that the NanoBEIREvaluator can be loaded and produces expected metrics
tests/sentence_transformer/evaluation/test_nanobeir_evaluator.py:31
Functiontest_nanobeir_evaluator_aggregate_key_with_underscore
Tests that the aggregated metrics keep their names when the aggregate_key contains an underscore
tests/sentence_transformer/evaluation/test_nanobeir_evaluator.py:96
Functiontest_nanobeir_evaluator_custom_dataset_id
Tests that the NanoBEIREvaluator can load and evaluate on a custom dataset_id
tests/sentence_transformer/evaluation/test_nanobeir_evaluator.py:48
Functiontest_nanobeir_evaluator_empty_inputs
Test that NanoBEIREvaluator behaves correctly with empty datasets.
tests/sentence_transformer/evaluation/test_nanobeir_evaluator.py:77
Functiontest_nanobeir_evaluator_main_score_function_as_string
Tests that main_score_function accepts a string, as the signature and docstring promise.
tests/sentence_transformer/evaluation/test_nanobeir_evaluator.py:83
Functiontest_nanobeir_evaluator_with_invalid_dataset
Test that NanoBEIREvaluator raises an error for invalid dataset names.
tests/sentence_transformer/evaluation/test_nanobeir_evaluator.py:63
Functiontest_native_mode_mappings_keep_gradient_calls_safe
(loader, embeddings)
tests/test_kernels.py:939
Functiontest_native_save_keeps_plain_transformer_unchanged
()
tests/multi_vector_encoder/test_model.py:1301
Methodtest_ndarray_1d_is_audio
(self)
tests/base/test_modality.py:167
Methodtest_ndarray_2d_is_audio
(self)
tests/base/test_modality.py:170
Methodtest_ndarray_3d_is_image
(self)
tests/base/test_modality.py:173
Methodtest_ndarray_4d_is_video
(self)
tests/base/test_modality.py:176
Methodtest_ndarray_5d_is_video
(self)
tests/base/test_modality.py:179
Methodtest_ndarray_not_affected_by_supported_modalities
Non-string inputs are unambiguous and should not be overridden by supported_modalities.
tests/base/test_modality.py:320
Functiontest_negative_dimension_raises_error
Test that negative dimension in matryoshka_dims raises ValueError.
tests/sentence_transformer/losses/test_matryoshka.py:63
Functiontest_negative_format
Basic test with 'negative' format produces valid metrics.
tests/cross_encoder/evaluation/test_reranking.py:15
Methodtest_nested_audio_config
(self, use_cache)
tests/base/modules/test_transformer.py:342
Methodtest_nested_dict_resolves_by_dataset_name
(self)
tests/base/test_data_collator.py:104
Methodtest_nested_dict_without_dataset_name_raises
(self)
tests/base/test_data_collator.py:109
Methodtest_nested_kd_shape
(self, queries: Dataset, documents: Dataset)
tests/util/test_dataset.py:89
Methodtest_nested_mapping_missing_dataset_returns_empty
(self)
tests/base/test_data_collator.py:87
Methodtest_nested_mapping_resolves_by_dataset_name
(self)
tests/base/test_data_collator.py:81
Methodtest_nested_plural_collision_raises_at_transform
(self, documents: Dataset)
tests/util/test_dataset.py:351
Functiontest_nested_router_roundtrip
(tmp_path: Path)
tests/base/modules/test_router.py:1569
Methodtest_new_kwargs_no_warning
(self, caplog)
tests/base/modules/test_transformer.py:506
Methodtest_new_name_no_warning
(self, caplog)
tests/util/test_decorators.py:37
Methodtest_new_name_no_warning
(self, caplog, old_name, new_name)
tests/util/test_decorators.py:118
Methodtest_newlines_replaced
(self)
tests/base/test_model_card.py:246
Methodtest_no_chat_template
(self)
tests/base/test_modality.py:454
Functiontest_no_duplicates_batch_sampler_cannot_form_batch_does_not_loop_forever
()
tests/base/samplers/test_no_duplicates_batch_sampler.py:322
Functiontest_no_duplicates_batch_sampler_caps_resample_passes
(caplog)
tests/base/samplers/test_no_duplicates_batch_sampler.py:362
Functiontest_no_duplicates_batch_sampler_deduplicates_audio
(precompute_hashes: bool)
tests/base/samplers/test_no_duplicates_batch_sampler.py:477
Functiontest_no_duplicates_batch_sampler_deduplicates_images
(precompute_hashes: bool)
tests/base/samplers/test_no_duplicates_batch_sampler.py:439
Functiontest_no_duplicates_batch_sampler_does_not_truncate_when_first_pass_exceeds_len
()
tests/base/samplers/test_no_duplicates_batch_sampler.py:287
Functiontest_no_duplicates_batch_sampler_list_values_match_between_hash_and_non_hash
()
tests/base/samplers/test_no_duplicates_batch_sampler.py:404
Functiontest_no_duplicates_batch_sampler_matches_reference_algorithm
( dummy_dataset: Dataset, drop_last: bool, precompute_hashes: bool )
tests/base/samplers/test_no_duplicates_batch_sampler.py:201
Functiontest_no_duplicates_batch_sampler_precomputed_hashes_are_int64
(dummy_dataset: Dataset)
tests/base/samplers/test_no_duplicates_batch_sampler.py:387
Functiontest_no_duplicates_batch_sampler_resamples_to_match_len
(precompute_hashes: bool)
tests/base/samplers/test_no_duplicates_batch_sampler.py:245
Functiontest_no_duplicates_batch_sampler_unique_data_matches_len_without_resample
()
tests/base/samplers/test_no_duplicates_batch_sampler.py:308
Functiontest_no_duplicates_batch_sampler_uses_int64_indices_when_int32_range_is_exceeded
( dummy_dataset: Dataset, monkeypatch: pytest.MonkeyPatch )
tests/base/samplers/test_no_duplicates_batch_sampler.py:561
Functiontest_no_duplicates_batch_sampler_warns_once_when_resampling
(caplog)
tests/base/samplers/test_no_duplicates_batch_sampler.py:338
Methodtest_no_id_column
(self)
tests/util/test_dataset.py:286
Methodtest_no_matching_columns_skips
If dataset has no columns matching the model's non-text modalities, nothing happens.
tests/base/test_model_card.py:684
Methodtest_no_op_when_pool_factor_1
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:220
Methodtest_no_positional_no_warning
(self, caplog)
tests/util/test_decorators.py:346
Functiontest_no_projection_by_default
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_embed_distill.py:124
Functiontest_no_relevant_docs_in_documents
Edge case: positive not in documents list.
tests/cross_encoder/evaluation/test_reranking.py:64
Methodtest_no_save_dir_is_noop
When save_dir is not set, nothing happens.
tests/base/test_model_card.py:409
Methodtest_no_stamp_without_router_mapping
(self)
tests/base/test_data_collator.py:239
Methodtest_no_usage_examples_is_noop
When usage_examples is None, nothing happens.
tests/base/test_model_card.py:418
Methodtest_no_warning_for_correct_order
(self, caplog)
tests/base/test_data_collator.py:160
Methodtest_no_warning_without_deprecated_kwargs
(self, caplog)
tests/util/test_decorators.py:409
Methodtest_no_warning_without_id_like_columns
(self, caplog)
tests/base/test_data_collator.py:178
Methodtest_non_dataset_rejected
(self)
tests/util/test_dataset.py:265
Methodtest_non_dict
(self)
tests/base/test_model_card.py:189
Functiontest_non_faiss_batched_search_matches_single_batch
Test that batching the non-FAISS similarity search splits the queries and does not change the mined negatives.
tests/util/test_hard_negatives.py:937
Methodtest_non_ir_delegates_to_base
Non-IR model falls through to the base implementation (single-modality examples).
tests/sentence_transformer/test_model_card.py:333
Methodtest_non_ir_evaluator_does_not_set_ir_model
(self)
tests/base/test_model_card.py:1583
Methodtest_non_ir_falls_through_to_base
When ir_model is None, SentenceTransformerModelCardData uses the base snippet.
tests/sentence_transformer/test_model_card.py:240
Functiontest_non_pooling_entry_raises
()
tests/multi_vector_encoder/losses/test_token_pooling.py:291
Methodtest_non_positive_budget_rejected_at_construction
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_gradcache.py:311
Functiontest_non_positive_dim_raises
()
tests/multi_vector_encoder/losses/test_matryoshka.py:159
Methodtest_non_positive_max_list_length
(self, documents: Dataset, bad: int)
tests/util/test_dataset.py:297
Methodtest_non_string_flat_content_kept_as_is
(self)
tests/base/test_modality.py:557
Methodtest_non_text_dispatch_multimodal
generate_usage_snippet dispatches to multimodal for dict usage_examples.
tests/base/test_model_card.py:546
Methodtest_non_text_dispatch_single_modality
PIL images in usage_examples cause single-modality dispatch, rendering display paths.
tests/base/test_model_card.py:559
Methodtest_non_text_multimodal_dict
Multimodal dicts produce inputs = [{...}, ...] format.
tests/base/test_model_card.py:513
Methodtest_non_text_pairs_become_message
Non-text pairs should be converted to message format.
tests/base/test_modality.py:1441
Methodtest_non_text_single_modality
Single non-text modality produces inputs = [...] format.
tests/base/test_model_card.py:532
Methodtest_none_returns_none
(self)
tests/base/test_data_collator.py:120
Functiontest_normalize_embeddings
Tests the correct computation of util.normalize_embeddings
tests/util/test_tensor.py:53
Functiontest_normalize_embeddings_single_sparse_vector
(values: list[float])
tests/util/test_tensor.py:123
Functiontest_normalize_embeddings_single_vector
()
tests/util/test_tensor.py:114
Functiontest_normalize_save_load_custom_keys
(tmp_path: Path)
tests/base/modules/test_normalize.py:10
Functiontest_normalize_sparse_embeddings_backward
(dtype: torch.dtype)
tests/util/test_tensor.py:103
Functiontest_normalize_sparse_embeddings_half_precision
( device: str, dtype: torch.dtype, ndim: int, size: int, value: float )
tests/util/test_tensor.py:86
Functiontest_normalize_sparse_embeddings_preserves_dtype
(dtype: torch.dtype, default_dtype: torch.dtype)
tests/util/test_tensor.py:67
Functiontest_normalized_mean_squared_error_nonzero_variance
(scale: float)
tests/sparse_encoder/losses/test_csr.py:53
Functiontest_normalized_mean_squared_error_zero_variance
( values: list[list[float]], offset: float, device: str, dtype: torch.dtype )
tests/sparse_encoder/losses/test_csr.py:32
Methodtest_nullable_ids_fall_back_to_dict
(self)
tests/util/test_dataset.py:542
Methodtest_nullable_uint64_ids_still_resolve
(self)
tests/util/test_dataset.py:527
Methodtest_num_images_per_sample_without_image_grid
Custom training loops need image counts without constructing a Trainer.
tests/base/modules/test_transformer.py:776
Functiontest_num_labels_fresh_model
()
tests/cross_encoder/test_model.py:461
Functiontest_num_labels_from_dense_scores_module
A Dense module with ``module_output_name="scores"`` should dictate ``num_labels``.
tests/cross_encoder/test_model.py:471
Functiontest_num_labels_ignores_dense_without_scores_output
A trailing Dense whose ``module_output_name`` is not ``"scores"`` must not be treated as the classification head by ``num_labels``.
tests/cross_encoder/test_model.py:485
Functiontest_num_negatives
Test num_negatives parameter.
tests/util/test_hard_negatives.py:385
Functiontest_num_negatives_exceeds_range_window
Requesting more negatives than the range window holds must explain itself, not fail on a tensor shape. Both strategies reach the same invalid win
tests/util/test_hard_negatives.py:1386
Functiontest_num_negatives_exceeds_range_window_capped_by_faiss
The FAISS GPU cap can shrink an auto-derived range_max below num_negatives, so the error mentions the cap.
tests/util/test_hard_negatives.py:1425
Functiontest_num_negatives_matching_range_window_is_allowed
A window exactly the size of num_negatives is still satisfiable, under either strategy, and must not raise.
tests/util/test_hard_negatives.py:1464
Functiontest_num_negatives_must_be_positive
range_max is derived from num_negatives, so a non-positive value must be named rather than mined around. Without the check, 0 quietly returns the
tests/util/test_hard_negatives.py:1408
Methodtest_num_protected_tokens_must_be_non_negative
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:552
Methodtest_num_protected_tokens_untouched
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:234
← previousnext →3,501–3,600 of 4,575, ranked by callers