Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/huggingface/sentence-transformers
/ functions
Functions
4,575 in github.com/huggingface/sentence-transformers
⨍
Functions
4,575
◇
Types & classes
516
↳
Endpoints
81
Function
test_tie_without_decoder_name_does_not_require_it
When tying, ``decoder_name_or_path`` may be omitted: it defaults to the encoder's checkpoint.
tests/sentence_transformer/losses/test_denoising_auto_encoder.py:95
Function
test_tied_scores
(num_positives: int | None, expected_ap: float)
tests/sparse_encoder/test_reciprocal_rank_fusion.py:133
Function
test_tied_scores_have_attainable_metrics
(duplicate_pair: tuple[str, str])
tests/sentence_transformer/evaluation/test_paraphrase_mining_evaluator.py:86
Function
test_tied_scores_only_credit_matching_text
(sources, targets, expected_src2trg, expected_trg2src)
tests/sentence_transformer/evaluation/test_translation_evaluator.py:49
Function
test_tied_weights_merged_once
(model)
tests/test_merging.py:111
Function
test_tied_weights_share_storage
With tying, every parameter shared by name between encoder and decoder is the *same object*.
tests/sentence_transformer/losses/test_denoising_auto_encoder.py:24
Function
test_ties_single_element_bias
()
tests/test_merging.py:509
Function
test_tiny_corpus
Test with a very small corpus to test edge case handling.
tests/util/test_hard_negatives.py:1644
Function
test_to
(inference_device: str)
tests/sentence_transformer/test_model.py:90
Function
test_to
(splade_bert_tiny_model: SparseEncoder, inference_device: str)
tests/sparse_encoder/test_model.py:21
Method
test_to_dict_skips_when_already_set
to_dict guards the call so an already-set ir_model is never overwritten.
tests/base/test_model_card.py:1589
Method
test_to_dict_triggers_lazy_detection
End-to-end: to_dict() runs the fallback so the snippet uses encode_query/encode_document.
tests/base/test_model_card.py:1600
Function
test_to_list_batches_columns
(dataset_format, indices, monkeypatch: pytest.MonkeyPatch)
tests/util/test_misc.py:19
Function
test_to_list_batches_custom_transforms
(nested: bool)
tests/util/test_misc.py:32
Function
test_to_list_numpy
(values)
tests/util/test_misc.py:13
Function
test_to_list_without_column
(missing: str, monkeypatch: pytest.MonkeyPatch)
tests/util/test_misc.py:48
Function
test_to_overloads_respect_device_map
(args: tuple, kwargs: dict, overrides_map: bool)
tests/base/test_model.py:1368
Function
test_to_scipy_coo_preserves_sparse_values
(dtype: torch.dtype, expected_dtype: type)
tests/util/test_tensor.py:43
Function
test_token_pooling_equals_manual_sum_of_pooled_losses
(build_inner, token_poolings, weights, use_generator)
tests/multi_vector_encoder/losses/test_token_pooling.py:119
Function
test_token_pooling_on_a_real_model
(mve_bert_tiny_model)
tests/multi_vector_encoder/losses/test_token_pooling.py:370
Function
test_token_pooling_with_kd_loss
()
tests/multi_vector_encoder/losses/test_token_pooling.py:147
Function
test_tokenize
(static_embedding: StaticEmbedding)
tests/sentence_transformer/modules/test_static_embedding.py:38
Function
test_tokenize_after_transformers_tokenizer_call
Calls of the transformers tokenizer that a StaticEmbedding was created with don't change its tokenization
tests/sentence_transformer/modules/test_static_embedding.py:46
Function
test_tokenize_deprecation_warning
tokenize() should emit a warning directing to preprocess().
tests/base/test_model.py:920
Method
test_tokenize_on_bare_subclass_raises
(self)
tests/base/modules/test_input_module.py:87
Method
test_tokenize_on_preprocess_subclass_warns_and_delegates
(self, caplog)
tests/base/modules/test_input_module.py:80
Method
test_tokenize_only_subclass_delegates_and_warns
(self, caplog)
tests/base/modules/test_input_module.py:49
Method
test_tokenize_only_subclass_prepends_prompt
(self)
tests/base/modules/test_input_module.py:56
Method
test_tokenizer_args_deprecated
(self, caplog)
tests/base/modules/test_transformer.py:494
Method
test_tokenizer_name_or_path_warning
tokenizer_name_or_path should emit a deprecation warning.
tests/base/modules/test_transformer.py:260
Function
test_top_100_with_missing_positives
()
tests/sparse_encoder/test_reciprocal_rank_fusion.py:99
Function
test_torch_dtype
(torch_dtype)
tests/sentence_transformer/test_model.py:111
Method
test_torch_formatted_lookup_resolves
(self, documents: Dataset)
tests/util/test_dataset.py:381
Function
test_track_loss_components_detaches_the_accumulated_values
The component dict values carry the autograd graph and, for the Cached* losses, the gradient caches held by their backward hook. Accumulating them
tests/base/test_trainer.py:228
Function
test_track_loss_components_replaces_nonfinite_with_the_running_mean
( training: bool, num_calls: int, global_step: int, nonfinite: float )
tests/base/test_trainer.py:258
Function
test_train_nli
( distilbert_base_uncased_model: SentenceTransformer, nli_resource: Dataset, stsb_dataset_dict: DatasetDic
tests/sentence_transformer/test_train_stsb.py:136
Function
test_train_nli_slow
( distilbert_base_uncased_model: SentenceTransformer, nli_resource: Dataset, stsb_dataset_dict: DatasetDic
tests/sentence_transformer/test_train_stsb.py:105
Function
test_train_stsb
(distilbert_base_uncased_model: SentenceTransformer, stsb_dataset_dict: DatasetDict)
tests/sentence_transformer/test_train_stsb.py:79
Function
test_train_stsb
(distilroberta_base_ce_model: CrossEncoder, stsb_dataset_dict: DatasetDict)
tests/cross_encoder/test_train_stsb.py:71
Function
test_train_stsb
(splade_bert_tiny_model: SparseEncoder, stsb_dataset_dict: DatasetDict, tmp_path)
tests/sparse_encoder/test_train_stsb.py:80
Function
test_train_stsb_slow
(distilbert_base_uncased_model: SentenceTransformer, stsb_dataset_dict: DatasetDict)
tests/sentence_transformer/test_train_stsb.py:53
Function
test_train_stsb_slow
(distilroberta_base_ce_model: CrossEncoder, stsb_dataset_dict: DatasetDict)
tests/cross_encoder/test_train_stsb.py:48
Function
test_train_stsb_slow
(splade_bert_tiny_model: SparseEncoder, stsb_dataset_dict: DatasetDict, tmp_path)
tests/sparse_encoder/test_train_stsb.py:45
Function
test_train_with_cached_mnr
(mve_bert_tiny_model: MultiVectorEncoder, triplet_dataset: Dataset)
tests/multi_vector_encoder/test_trainer.py:92
Function
test_train_with_distill_kl
(mve_bert_tiny_model: MultiVectorEncoder, kd_dataset: Dataset)
tests/multi_vector_encoder/test_trainer.py:98
Function
test_train_with_margin_mse
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/test_trainer.py:104
Function
test_train_with_mnr
(mve_bert_tiny_model: MultiVectorEncoder, triplet_dataset: Dataset)
tests/multi_vector_encoder/test_trainer.py:86
Function
test_trainer
Some cases are not allowed: * streaming=True and train_dict=True: streaming is not supported with DatasetDict, because our DatasetDict
tests/sentence_transformer/test_trainer.py:318
Function
test_trainer
Some cases are not allowed: * streaming=True and train_dict=True: streaming is not supported with DatasetDict, because our DatasetDict
tests/cross_encoder/test_trainer.py:121
Function
test_trainer
( splade_bert_tiny_model: SparseEncoder, dummy_train_eval_datasets_for_trainer: tuple[Dataset, Dataset
tests/sparse_encoder/test_trainer.py:73
Function
test_trainer_accepts_probability_labels
(model: SentenceTransformer, tmp_path)
tests/sentence_transformer/losses/test_softmax.py:91
Function
test_trainer_batch_sampler_uses_args_seed
Changing ``args.seed`` should change the batch order, as it does for the default batch sampler.
tests/sentence_transformer/test_trainer.py:936
Function
test_trainer_call_model_init_multi_loss
Test that call_model_init correctly updates the model in each loss function for multi-loss training.
tests/sentence_transformer/test_trainer.py:1141
Function
test_trainer_checkpointing
(stsb_bert_tiny_model: SentenceTransformer, tmp_path: Path, name: str)
tests/sentence_transformer/test_trainer.py:51
Function
test_trainer_compiled_model_with_cached_loss
( stsb_bert_tiny_model: SentenceTransformer, compile_before_loss: bool )
tests/sentence_transformer/test_trainer.py:1333
Function
test_trainer_evaluate_caches_eval_dataloaders_per_dataset
( stsb_bert_tiny_model: SentenceTransformer, stsb_dataset_dict: DatasetDict, persistent_workers: b
tests/sentence_transformer/test_trainer.py:1264
Function
test_trainer_featureless_iterable_dataset_hint_covers_list_columns
( stsb_bert_tiny_model: SentenceTransformer, )
tests/sentence_transformer/test_trainer.py:396
Function
test_trainer_get_batch_sampler_class
Test that you can specify a batch_sampler class in args.
tests/sentence_transformer/test_trainer.py:888
Function
test_trainer_get_batch_sampler_function
Test that you can specify a batch_sampler function in args.
tests/sentence_transformer/test_trainer.py:958
Function
test_trainer_get_eval_dataloader_with_persistent_workers
( stsb_bert_tiny_model: SentenceTransformer, stsb_dataset_dict: DatasetDict, persistent_workers: b
tests/sentence_transformer/test_trainer.py:1196
Function
test_trainer_get_multi_dataset_batch_sampler_class
Test that you can specify a multi_dataset_batch_sampler class in args.
tests/sentence_transformer/test_trainer.py:1017
Function
test_trainer_get_multi_dataset_batch_sampler_function
Test that you can specify a multi_dataset_batch_sampler function in args.
tests/sentence_transformer/test_trainer.py:1074
Function
test_trainer_invalid_column_names
( stsb_bert_tiny_model: SentenceTransformer, stsb_dataset_dict: DatasetDict )
tests/sentence_transformer/test_trainer.py:208
Function
test_trainer_logs_eval_loss_components_under_the_metric_key_prefix
( splade_bert_tiny_model: SparseEncoder, tmp_path: Path, during_training: bool )
tests/sparse_encoder/test_trainer.py:480
Function
test_trainer_multi_dataset_errors
( stsb_bert_tiny_model: SentenceTransformer, stsb_dataset_dict: DatasetDict )
tests/sentence_transformer/test_trainer.py:143
Function
test_trainer_multi_dataset_errors
(reranker_bert_tiny_model: CrossEncoder, stsb_dataset_dict: DatasetDict)
tests/cross_encoder/test_trainer.py:30
Function
test_trainer_no_eval_dataset_with_eval_strategy
( stsb_bert_tiny_model: SentenceTransformer, stsb_dataset_dict: DatasetDict, use_eval_dataset: boo
tests/sentence_transformer/test_trainer.py:753
Function
test_trainer_prompts
( stsb_bert_tiny_model: SentenceTransformer, train_dict: bool, eval_dict: bool, loss_dict: boo
tests/sentence_transformer/test_trainer.py:443
Function
test_trainer_prompts
Test that prompts are correctly passed to loss functions during CrossEncoder training.
tests/cross_encoder/test_trainer.py:217
Function
test_trainer_prompts
( splade_bert_tiny_model: SparseEncoder, train_dict: bool, eval_dict: bool, loss_dict: bool,
tests/sparse_encoder/test_trainer.py:152
Function
test_trainer_prompts_per_column_rejected
Test that per-column prompts are rejected for CrossEncoder.
tests/cross_encoder/test_trainer.py:313
Function
test_trainer_router_mapping_per_column_rejected
Test that per-column router_mapping is rejected for CrossEncoder.
tests/cross_encoder/test_trainer.py:322
Function
test_trainer_schedules_every_splade_loss
(splade_bert_tiny_model: SparseEncoder, tmp_path: Path)
tests/sparse_encoder/test_trainer.py:446
Function
test_trainer_tensor_formatted_labels
The default losses train on a dataset with tensor labels, e.g. after with_format("torch").
tests/cross_encoder/test_trainer.py:332
Function
test_training_updates_loss_weights
(stsb_bert_tiny_model, tmp_path, monkeypatch, use_fit: bool)
tests/sentence_transformer/test_trainer.py:1346
Method
test_transform_is_picklable
(self, queries: Dataset, documents: Dataset)
tests/util/test_dataset.py:371
Method
test_transformed_content_still_counts_as_rendered
A template may reshape what it renders, and the content still reaches the model.
tests/base/test_modality.py:1622
Function
test_transformer_configuration_error_details
(stsb_bert_tiny_model)
tests/test_merging.py:275
Function
test_transformer_configuration_missing_field
(stsb_bert_tiny_model, position)
tests/test_merging.py:301
Function
test_transformer_models
(request, fixture_name, method, tmp_path)
tests/test_merging.py:484
Method
test_transformers_heads_and_tied_embeddings
(self, architecture)
tests/cross_encoder/test_model.py:1480
Function
test_transformers_model_property
Test that the transformers_model property returns the underlying transformers model.
tests/sentence_transformer/test_model.py:1375
Function
test_triplet_distance_matches_full_precision
(dtype, autocast, squared, case)
tests/sentence_transformer/losses/test_triplet_distance_precision.py:22
Function
test_triplet_evaluator
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/evaluation/test_triplet.py:11
Function
test_triplet_evaluator_config_dict_margin
()
tests/sentence_transformer/evaluation/test_triplet_evaluator.py:49
Function
test_triplet_evaluator_config_dict_margin
()
tests/multi_vector_encoder/evaluation/test_triplet.py:43
Function
test_triplet_evaluator_csv_columns_are_aligned
( splade_bert_tiny_model: SparseEncoder, tmp_path: Path, similarity_fn_names: list[str] | None )
tests/sparse_encoder/evaluation/test_triplet_evaluator.py:13
Function
test_triplet_evaluator_main_similarity_function_is_evaluated
(stsb_bert_tiny_model: SentenceTransformer)
tests/sentence_transformer/evaluation/test_triplet_evaluator.py:41
Function
test_triplet_evaluator_rejects_dense_margin_keys
()
tests/multi_vector_encoder/evaluation/test_triplet.py:59
Function
test_triplet_evaluator_rejects_unknown_margin_keys
()
tests/sentence_transformer/evaluation/test_triplet_evaluator.py:59
Function
test_triplet_evaluator_rejects_unknown_similarity_fn_names
()
tests/sentence_transformer/evaluation/test_triplet_evaluator.py:64
Function
test_triplet_evaluator_token_pooling_and_truncate_dim
(mve_bert_tiny_model: MultiVectorEncoder)
tests/multi_vector_encoder/evaluation/test_triplet.py:65
Function
test_triplet_evaluator_writes_csv_rows
(mve_bert_tiny_model: MultiVectorEncoder, tmp_path)
tests/multi_vector_encoder/evaluation/test_triplet.py:25
Function
test_triplet_loss_correct_direction
Loss should be lower when the positive is closer to the anchor than the negative.
tests/sentence_transformer/losses/test_triplet.py:27
Function
test_triplet_output_scores_match_similarity
Verify that triplet scores match recomputed query-positive/negative similarity. We validate both the simple dataset and the multiple-positive dat
tests/util/test_hard_negatives.py:693
Method
test_triplet_shape_shares_one_lookup
(self, queries: Dataset, documents: Dataset)
tests/util/test_dataset.py:54
Method
test_true_with_flash_attention
With flash attention and a compatible model, flattening should be enabled.
tests/base/modules/test_transformer.py:2252
Function
test_truncate_dim_slicing
(mve_bert_tiny_model: MultiVectorEncoder, truncate_dim: int, use_default: bool)
tests/multi_vector_encoder/test_model.py:1490
Method
test_truncates_ids_and_list_labels_in_parallel
(self, queries: Dataset, documents: Dataset)
tests/util/test_dataset.py:160
Method
test_truncation_applies
(self, documents: Dataset)
tests/util/test_dataset.py:102
← previous
next →
4,301–4,400 of 4,575, ranked by callers