MCPcopy Create free account

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

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

Methodtest_expanded_position_collision_raises_at_transform
(self, documents: Dataset)
tests/util/test_dataset.py:344
Methodtest_expansion_pad_contract_survives_processing_kwargs
A processing_kwargs padding/max_length override must not silently break the expansion's fixed width (which would make query embeddings depend
tests/base/modules/test_transformer.py:893
Functiontest_explicit_activation_overrides_unconstructible_saved_activation
( reranker_bert_tiny_model: CrossEncoder, tmp_path: Path )
tests/cross_encoder/test_model.py:770
Methodtest_explicit_flat
(self)
tests/base/test_modality.py:418
Functiontest_explicit_move_overrides_a_single_device_map
(move_method: str)
tests/base/test_model.py:1339
Functiontest_explicit_score_functions_survive_reuse
Explicit score_functions are evaluator configuration, so a model carrying a different similarity does not replace them.
tests/sentence_transformer/evaluation/test_information_retrieval_evaluator.py:141
Functiontest_explicit_slerp_base_and_interpolation
(model)
tests/test_merging.py:86
Methodtest_explicit_structured
(self)
tests/base/test_modality.py:414
Methodtest_explicit_text_pair_keeps_pair_roles
(self, container)
tests/base/test_modality.py:1090
Methodtest_explode_positions_align_across_rows
(self, documents: Dataset)
tests/util/test_dataset.py:38
Functiontest_export_false_subfolder
()
tests/sentence_transformer/test_backends.py:180
Functiontest_export_false_subfolder
()
tests/cross_encoder/test_backends.py:188
Functiontest_export_false_subfolder
()
tests/sparse_encoder/test_backends.py:183
Functiontest_export_set_nested_filename
()
tests/sentence_transformer/test_backends.py:198
Functiontest_export_set_nested_filename
()
tests/cross_encoder/test_backends.py:206
Functiontest_export_set_nested_filename
()
tests/sparse_encoder/test_backends.py:199
Methodtest_extra_keys_preserved_flat_to_structured
(self)
tests/base/test_modality.py:1250
Methodtest_extra_keys_preserved_structured_to_flat
(self)
tests/base/test_modality.py:1257
Methodtest_failure_distinguishes_an_empty_render_from_a_raise
(self)
tests/base/test_modality.py:1684
Methodtest_failure_names_the_half_that_is_dropped
(self)
tests/base/test_modality.py:1652
Functiontest_faiss
Test use_faiss parameter.
tests/util/test_hard_negatives.py:907
Functiontest_faiss_corpus_smaller_than_k
Candidates must never include a query's own positives when ``k`` exceeds the corpus size. FAISS pads short result sets with index -1 and score -3
tests/util/test_hard_negatives.py:1179
Functiontest_faiss_corpus_smaller_than_k_with_cross_encoder
The FAISS -1 padding must stay disqualified after the CrossEncoder rescoring. The rescoring assigns a fresh score to every candidate, so disquali
tests/util/test_hard_negatives.py:1216
Functiontest_faiss_multiple_positives_matches_non_faiss
FAISS and non-FAISS paths must mine the same number of negatives when queries have multiple positives. Regression test for the FAISS branch reque
tests/util/test_hard_negatives.py:1149
Methodtest_falls_back_to_the_type_name
(self)
tests/util/test_misc.py:259
Methodtest_false_for_non_feature_extraction_task
Flattening requires the feature-extraction task.
tests/base/modules/test_transformer.py:2222
Methodtest_false_for_non_torch_backend
Flattening requires the torch backend.
tests/base/modules/test_transformer.py:2229
Methodtest_false_when_backend_incompatible
If the model's auto_model reports backend incompatibility, flattening is disabled.
tests/base/modules/test_transformer.py:2245
Methodtest_false_when_no_flash_attention
Without flash attention, flattening should be disabled.
tests/base/modules/test_transformer.py:2238
Functiontest_first_inference_alignment_retries_after_failure
()
tests/base/test_model.py:1265
Functiontest_fit_saves_best_model_and_calls_callback_after_each_epoch
CrossEncoder.fit() evaluates after each epoch, saves the best model to `output_path` and calls `callback`.
tests/cross_encoder/test_trainer.py:389
Functiontest_fit_scheduler_covers_every_objective_step
( stsb_bert_tiny_model, tmp_path, monkeypatch, num_objectives: int )
tests/sentence_transformer/test_trainer.py:1384
Functiontest_fit_with_custom_batch_sampler
(stsb_bert_tiny_model, tmp_path, monkeypatch, caplog)
tests/sentence_transformer/test_trainer.py:1428
Functiontest_fit_with_custom_batch_sampler
CrossEncoder.fit() accepts a DataLoader built with `batch_sampler=...` and warns that it is not used.
tests/cross_encoder/test_trainer.py:448
Functiontest_fit_with_float_evaluator_saves_best_model_and_calls_callback
( stsb_bert_tiny_model, tmp_path, monkeypatch )
tests/sentence_transformer/test_trainer.py:1447
Functiontest_fit_with_loss_fct
CrossEncoder.fit() trains with a plain torch loss passed as `loss_fct`.
tests/cross_encoder/test_trainer.py:423
Functiontest_fit_with_uneven_number_of_texts
(stsb_bert_tiny_model, tmp_path, monkeypatch)
tests/sentence_transformer/test_trainer.py:1417
Methodtest_fixed_expansion_warns_on_truncated_queries
strategy='fixed' silently loses content past the expansion length (the width is fixed in both directions), so the first such batch must warn.
tests/base/modules/test_transformer.py:972
Methodtest_fixed_size_splitting_unchanged
(self)
tests/sentence_transformer/losses/test_gradcache.py:277
Methodtest_flat_dict_prompt
(self)
tests/base/test_data_collator.py:99
Methodtest_flat_format
(self)
tests/base/test_modality.py:1203
Methodtest_flat_format
(self)
tests/base/test_modality.py:1383
Methodtest_flat_mapping_returned_as_is
(self)
tests/base/test_data_collator.py:75
Methodtest_flat_multimodal_falls_back_to_structured
(self)
tests/base/test_modality.py:475
Methodtest_flat_single_text
(self)
tests/base/test_modality.py:470
Methodtest_flat_template_without_structured_patterns
(self)
tests/base/test_modality.py:447
Methodtest_flat_text_only
Flat format messages with string content are text-only.
tests/base/test_modality.py:1507
Methodtest_flat_to_structured
(self)
tests/base/test_modality.py:517
Functiontest_flattened_forward_backward
()
tests/sparse_encoder/modules/test_splade_pooling.py:41
Functiontest_flattened_forward_matches_padded
(pooling_strategy: str, activation_function: str, training: bool)
tests/sparse_encoder/modules/test_splade_pooling.py:12
Functiontest_float32_inputs_are_unchanged
HPS is a no-op for embeddings that are already float32.
tests/util/test_similarity.py:579
Methodtest_float_column_stats
(self, stsb_bert_tiny_model: SentenceTransformer)
tests/base/test_model_card.py:892
Functiontest_formatted_dataset
( dataset: Dataset, static_retrieval_mrl_en_v1_model: SentenceTransformer, dataset_format: str )
tests/util/test_hard_negatives.py:1059
Methodtest_formatted_train_dataset_raises_clear_error
( self, queries: Dataset, documents: Dataset, dataset_format: str )
tests/util/test_dataset.py:395
Methodtest_formatted_train_dataset_raises_without_list_ids
(self, queries: Dataset, documents: Dataset)
tests/util/test_dataset.py:412
Functiontest_forward
(static_embedding: StaticEmbedding)
tests/sentence_transformer/modules/test_static_embedding.py:59
Methodtest_forward_applies_the_budget
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:406
Functiontest_forward_backward_flows_grad_to_tied_weight
A train step produces a finite scalar and flows gradient into the tied embedding.
tests/sentence_transformer/losses/test_denoising_auto_encoder.py:76
Methodtest_forward_backward_with_pooling_in_pipeline
(self, normalize_embeddings: bool)
tests/multi_vector_encoder/modules/test_token_pooling.py:362
Methodtest_forward_empty_batch
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:576
Methodtest_forward_empty_inputs
Test that forward with an empty batch (zero-length tensors) either raises a RuntimeError or returns empty outputs, depending on the PyTorch/tr
tests/base/modules/test_transformer.py:2484
Methodtest_forward_fully_padded_row_in_batch
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:589
Methodtest_forward_mask_and_gradient
(self, dtype: torch.dtype)
tests/multi_vector_encoder/modules/test_token_pooling.py:451
Methodtest_forward_pools_documents
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:328
Methodtest_forward_pools_queries_when_opted_in
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:349
Functiontest_forward_produces_finite_scalar
(stsb_bert_tiny_model: SentenceTransformer, distance_metric: str)
tests/sentence_transformer/losses/test_embed_distill.py:30
Methodtest_forward_skips_queries
(self, pool_factor: float, normalize_embeddings: bool)
tests/multi_vector_encoder/modules/test_token_pooling.py:339
Methodtest_forward_values_match_with_and_without_gradients
(self, dtype: torch.dtype)
tests/multi_vector_encoder/modules/test_token_pooling.py:515
Methodtest_fractional_pool_factor
(self, pool_factor: float, expected_tokens: int)
tests/multi_vector_encoder/modules/test_token_pooling.py:243
Methodtest_frames_stay_one_video_in_processor
(self, container, frame_type, wrapped_frames)
tests/base/test_modality.py:654
Functiontest_from_distillation
()
tests/sentence_transformer/modules/test_static_embedding.py:76
Functiontest_from_distillation_passes_device_to_model2vec
( monkeypatch: pytest.MonkeyPatch, device_kwargs: dict[str, str | None] )
tests/sentence_transformer/modules/test_static_embedding.py:88
Functiontest_from_model2vec
()
tests/sentence_transformer/modules/test_static_embedding.py:120
Functiontest_from_model2vec_mapping_and_weights
(tmp_path: Path)
tests/sentence_transformer/modules/test_static_embedding.py:167
Functiontest_from_text_file_creates_independent_default_tokenizers
Loading another embedding file must not replace an earlier model's vocabulary.
tests/sentence_transformer/modules/test_word_embeddings.py:88
Functiontest_full_dim_only_matches_wrapped_loss
(build_inner)
tests/multi_vector_encoder/losses/test_matryoshka.py:69
Functiontest_fully_custom_column_names
Test dataset with completely different column names.
tests/util/test_hard_negatives.py:150
Functiontest_gather_rank1_margin_zero_baseline
Sanity baseline: with margin=0 the positive equals its own threshold and is not suppressed regardless of the mask, so the loss is finite both befo
tests/sentence_transformer/losses/test_gist_embed.py:73
Functiontest_gather_rank1_margin_zero_baseline
Sanity baseline: with margin=0 the positive equals its own threshold and is not suppressed regardless of the mask, so the loss is finite both befo
tests/sentence_transformer/losses/test_cached_gist_embed.py:183
Functiontest_gather_rank1_positive_not_masked_with_margin
Regression for the rank>0 positive-mask offset bug in the non-cached GISTEmbedLoss. The old ``torch.eye(*shape)`` mask protects columns [0..batch
tests/sentence_transformer/losses/test_gist_embed.py:60
Functiontest_gather_rank1_positive_not_masked_with_margin
Regression for the rank>0 positive-mask offset bug (gather_across_devices). On rank 1, each anchor's true positive lives at gathered column ``off
tests/sentence_transformer/losses/test_cached_gist_embed.py:165
Functiontest_generated_from_trainer_tag
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/test_model_card_data.py:33
Methodtest_generates_examples_for_custom_transform_dataset
(self)
tests/base/test_model_card.py:78
Methodtest_generates_examples_for_plain_text_dataset
(self)
tests/base/test_model_card.py:160
Methodtest_generic_id_column_in_both_lookups
(self)
tests/util/test_dataset.py:253
Methodtest_get_batch_size
(self, mixed_modality_features)
tests/sentence_transformer/losses/test_cmnrl.py:249
Functiontest_get_config_dict
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/losses/test_embed_distill.py:130
Methodtest_get_config_dict
(self, bert_tiny_transformer)
tests/base/modules/test_transformer.py:1962
Functiontest_get_config_dict_describes_variants
()
tests/multi_vector_encoder/losses/test_token_pooling.py:351
Functiontest_get_config_dict_reports_add_transitive_closure_flag
get_config_dict must report the ``add_transitive_closure`` init flag, not the static method of the same name, so that the config can be serialized
tests/sentence_transformer/evaluation/test_paraphrase_mining_evaluator.py:35
Methodtest_get_config_dict_tuple_keys_serialized
Tuple modality keys should be serialized to plus-separated strings.
tests/base/modules/test_transformer.py:1967
Functiontest_get_device_name_cuda_without_distributed_is_initialized
(monkeypatch: pytest.MonkeyPatch)
tests/util/test_environment.py:21
Methodtest_get_embedding_dimension
Test that embedding dimension can be retrieved.
tests/base/modules/transformer/test_any_to_any.py:104
Methodtest_get_embedding_dimension
Test that embedding dimension can be retrieved.
tests/base/modules/transformer/test_text_generation.py:95
Methodtest_get_embedding_dimension
Test that embedding dimension can be retrieved.
tests/base/modules/transformer/test_sequence_classification.py:96
Methodtest_get_embedding_dimension
Test that embedding dimension can be retrieved.
tests/base/modules/transformer/test_fill_mask.py:86
Methodtest_get_embedding_dimension
Test that word embedding dimension can be retrieved.
tests/base/modules/transformer/test_feature_extraction.py:101
Functiontest_get_installed_version_falls_back_to_metadata
Modules without a usable __version__ resolve via the distribution metadata.
tests/util/test_environment.py:135
Functiontest_get_installed_version_missing_package
()
tests/util/test_environment.py:115
Functiontest_get_installed_version_prefers_imported_module
Editable installs report stale distribution metadata, so the imported module wins.
tests/util/test_environment.py:128
← previousnext →2,801–2,900 of 4,575, ranked by callers