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_sparse_static_embedding_loads_json_checkpoint
(tmp_path: Path, explicit_cache_folder: bool)
tests/sparse_encoder/modules/test_sparse_static_embedding.py:87
Function
test_sparse_static_embedding_padding_ignored
(inference_free_splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/modules/test_sparse_static_embedding.py:16
Function
test_sparse_static_embedding_save_load
( inference_free_splade_bert_tiny_model: SparseEncoder, tmp_path: Path )
tests/sparse_encoder/modules/test_sparse_static_embedding.py:33
Function
test_sparsity
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_model.py:424
Function
test_splade_configuration_mismatch
(splade_bert_tiny_model, problem)
tests/test_merging.py:435
Function
test_splade_loss_document_only_mode_merges_every_column
With use_document_regularizer_only every column is a document under one regularizer, so there is no query column to keep on its own forward and al
tests/sparse_encoder/losses/test_merged_forward.py:65
Function
test_splade_loss_merged_forward_matches_per_column
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/losses/test_merged_forward.py:52
Function
test_splade_pooling_chunk_size
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_model.py:446
Function
test_splade_pooling_dimension_metadata
(splade_bert_tiny_model, evaluated_first, dimension)
tests/test_merging.py:419
Function
test_stacked_modifiers_cached_matches_non_cached
()
tests/multi_vector_encoder/losses/test_token_pooling.py:172
Function
test_stacked_modifiers_fp16_padding_has_finite_gradients
(mve_bert_tiny_model, build_inner)
tests/multi_vector_encoder/losses/test_token_pooling.py:203
Function
test_stacked_modifiers_match_encoding
(mve_bert_tiny_model, build_inner)
tests/multi_vector_encoder/losses/test_token_pooling.py:247
Method
test_standard_hidden_size
(self, bert_tiny_transformer)
tests/base/modules/test_transformer.py:1137
Function
test_stanford_colbert_archetype_keeps_caller_prompts
``artifact.metadata`` carries no prompt, so the marker only fills a slot the caller left alone. An empty string is the documented way to switch a
tests/multi_vector_encoder/test_model.py:720
Function
test_stanford_colbert_archetype_without_metadata_uses_defaults
``artifact.metadata`` is absent from some Stanford-shaped repos, so the loader falls back to the canonical markers and a 32-token query expansion
tests/multi_vector_encoder/test_model.py:691
Function
test_stanford_metadata_seeds_skiplist_from_mask_punctuation
A Stanford-NLP load seeds the skiplist from the ``mask_punctuation`` flag in ``artifact.metadata``. ColBERTConfig declares ``mask_punctuation: boo
tests/multi_vector_encoder/test_model.py:482
Function
test_static_openvino_quantization_config
(monkeypatch: pytest.MonkeyPatch, config_type: str)
tests/util/test_backend.py:32
Method
test_str_modality
(self)
tests/base/test_modality.py:1131
Method
test_string_encoded_integer_ids
(self)
tests/util/test_dataset.py:142
Method
test_string_encoded_list_gets_a_hint
(self, documents: Dataset)
tests/util/test_dataset.py:316
Method
test_string_ids_use_the_sorted_index
(self, documents: Dataset)
tests/util/test_dataset.py:452
Method
test_string_keep_columns_rejected
(self, documents: Dataset)
tests/util/test_dataset.py:301
Method
test_string_not_pair
(self)
tests/base/test_modality.py:1322
Function
test_string_positive
Positive as a string (not list) is handled correctly.
tests/cross_encoder/evaluation/test_reranking.py:86
Method
test_string_prompt
(self)
tests/base/test_data_collator.py:95
Method
test_string_prompt_returns_for_any_column
(self)
tests/base/test_data_collator.py:126
Method
test_structured_cross_modality
(self)
tests/base/test_modality.py:1372
Method
test_structured_format
(self)
tests/base/test_modality.py:1194
Method
test_structured_multimodal
(self)
tests/base/test_modality.py:488
Method
test_structured_multimodal_preserves_dict_ordering
Content items should follow the input dict's key order, not alphabetical.
tests/base/test_modality.py:497
Method
test_structured_same_modality
(self)
tests/base/test_modality.py:1361
Method
test_structured_single_modality
(self)
tests/base/test_modality.py:483
Method
test_structured_template_with_type_pattern
(self)
tests/base/test_modality.py:440
Method
test_structured_text_implicit_type
Structured items without an explicit 'type' key default to text.
tests/base/test_modality.py:1517
Method
test_structured_text_only
Structured format messages with only text items are text-only.
tests/base/test_modality.py:1512
Method
test_structured_to_flat_multi_item_keeps_structured
(self)
tests/base/test_modality.py:529
Method
test_structured_to_flat_single_text
(self)
tests/base/test_modality.py:523
Method
test_structured_with_audio
Messages containing an audio item are not text-only.
tests/base/test_modality.py:1537
Method
test_structured_with_image
Messages containing an image item are not text-only.
tests/base/test_modality.py:1522
Method
test_suffix_stripping_single_columns
(self, documents: Dataset, input_col: str, output_col: str)
tests/util/test_dataset.py:224
Function
test_suggest_extra_monkeypatch_missing_pillow
Simulate AutoProcessor.from_pretrained raising ImportError for missing Pillow.
tests/util/test_environment.py:85
Function
test_suggest_extra_monkeypatch_missing_torchcodec
Simulate AutoProcessor.from_pretrained raising AttributeError for missing torchcodec.
tests/util/test_environment.py:98
Function
test_suggest_extra_on_exception_adds_hint
( exception_cls: type[Exception], message: str, expected_snippet: str )
tests/util/test_environment.py:54
Function
test_suggest_extra_on_exception_ignores_other_exceptions
()
tests/util/test_environment.py:74
Function
test_suggest_extra_on_exception_no_exception
()
tests/util/test_environment.py:80
Function
test_suggest_extra_on_exception_preserves_exception_type
()
tests/util/test_environment.py:62
Function
test_suggest_extra_on_exception_reraises_unmatched
()
tests/util/test_environment.py:68
Method
test_supports_consistency
Test that supports() is consistent with the modalities property. For each architecture, verifies that: 1. Each listed modality is sup
tests/base/modules/transformer/test_feature_extraction.py:130
Function
test_supports_parametrized
( monkeypatch: pytest.MonkeyPatch, stsb_bert_tiny_model: SentenceTransformer, modalities: list,
tests/base/test_model.py:403
Method
test_system_messages_are_independent
Each message list should get its own system message dict (no shared mutable state).
tests/base/test_modality.py:1266
Function
test_target_device_backwards_compat
()
tests/cross_encoder/test_model.py:452
Function
test_task_kwarg_does_not_break_stock_template_processor
End-to-end guard on a real ProcessorMixin backbone with a stock (non-task-aware) chat template: batched ragged text preprocessing with a task must
tests/multi_vector_encoder/test_model.py:113
Function
test_task_not_forwarded_to_templates_that_ignore_it
transformers >= 5.4 treats apply_chat_template kwargs that are not template variables as processor kwargs and REPLACES the ones we pass (dropping
tests/multi_vector_encoder/test_model.py:94
Method
test_task_outside_tasks_returns_input_unchanged
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:91
Method
test_task_stamped_when_router_mapping_resolves
(self)
tests/base/test_data_collator.py:233
Method
test_tasks_accepts_a_bare_string
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:564
Method
test_tasks_round_trip_through_config
(self, tmp_path)
tests/multi_vector_encoder/modules/test_token_pooling.py:568
Method
test_tensor_1d_is_audio
(self)
tests/base/test_modality.py:182
Method
test_tensor_3d_is_image
(self)
tests/base/test_modality.py:185
Method
test_tensor_4d_is_video
(self)
tests/base/test_modality.py:188
Method
test_tensor_bad_ndim_raises
(self)
tests/base/test_modality.py:295
Method
test_tensor_formatted_dataset_labels
(self, label_shape)
tests/base/test_data_collator.py:61
Function
test_tensor_formatted_list_labels
()
tests/cross_encoder/test_data_collator.py:28
Function
test_tensor_formatted_scalar_labels
(labels: list)
tests/cross_encoder/test_data_collator.py:14
Method
test_tensor_text_pair
(self)
tests/base/test_modality.py:1312
Method
test_tensor_video_falls_through_to_fallback
A 4D tensor column (video modality) isn't handled by the VideoDecoder branch, so it hits the fallback: dtype is the fully-qualified class name
tests/base/test_model_card.py:939
Method
test_text_and_image_collections_preserve_content_order
(self, container, text_count, images_first, paired)
tests/base/test_modality.py:1031
Method
test_text_column_still_tokenizes
Plain text columns still get token-length stats (no regression for the common case).
tests/base/test_model_card.py:853
Method
test_text_config_fallback
Should fall back to text_config.hidden_size when main config lacks it.
tests/base/modules/test_transformer.py:1172
Method
test_text_custom_examples
usage_examples strings appear in the snippet.
tests/base/test_model_card.py:444
Method
test_text_default_examples
Default examples are used when usage_examples is None.
tests/base/test_model_card.py:432
Method
test_text_image_pair
(self)
tests/base/test_modality.py:1299
Method
test_text_inputs
(self)
tests/base/test_modality.py:570
Method
test_text_inputs_are_flattened
Text inputs should be flattened when can_flatten_inputs is True.
tests/base/modules/test_transformer.py:2320
Method
test_text_inputs_not_flattened_when_disabled
Text inputs should NOT be flattened when can_flatten_inputs is False.
tests/base/modules/test_transformer.py:2325
Method
test_text_modality_in_card
Text-only model shows 'Text' in supported modalities.
tests/base/test_model_card.py:996
Method
test_text_model_card_valid
Text model generates a valid card with no triple newlines.
tests/base/test_model_card.py:977
Method
test_text_model_id
model_id appears in the loading line, or a placeholder is used when None.
tests/base/test_model_card.py:482
Method
test_text_model_roundtrip
(self, tmp_path: Path, model_name: str, expected_class_name: str, extra_kwargs: dict)
tests/base/modules/test_transformer.py:2130
Method
test_text_only
(self)
tests/base/modules/test_transformer.py:2425
Method
test_text_only_does_not_create_assets_dir
When all examples are text (flat or CrossEncoder-style pairs), no assets dir is created.
tests/base/test_model_card.py:286
Method
test_text_only_messages_are_flattened
Messages with only text content should be flattened when can_flatten_inputs is True.
tests/base/modules/test_transformer.py:2367
Method
test_text_only_model_skips
Text-only model does not produce multimodal usage_examples.
tests/base/test_model_card.py:645
Method
test_text_only_sample_omits_image_inputs
(self, features)
tests/sentence_transformer/losses/test_cmnrl.py:368
Method
test_text_output_dimensionality
Embedding dimension appears in the shape comment.
tests/base/test_model_card.py:491
Method
test_text_pair_inputs
(self)
tests/base/test_modality.py:576
Method
test_text_pair_is_not_non_text
(self)
tests/base/test_modality.py:1289
Method
test_text_pair_list
(self)
tests/base/test_modality.py:145
Method
test_text_pair_list_is_not_non_text
(self)
tests/base/test_modality.py:1292
Method
test_text_pair_tuple
(self)
tests/base/test_modality.py:142
Method
test_text_pairs
(self)
tests/base/test_modality.py:1231
Method
test_text_pairs_stay_as_text
Text pairs should be detected as 'text' modality (tokenizer handles natively).
tests/base/test_modality.py:1433
Method
test_text_text_pair
(self)
tests/base/test_modality.py:1393
Method
test_text_with_similarities
When similarities are computed, they appear in the snippet.
tests/base/test_model_card.py:455
Method
test_text_without_similarities
When no similarities, shape comment is shown.
tests/base/test_model_card.py:465
Function
test_third_party_module_with_strict_load_signature_round_trips
The loader passes init_defaults to module.load() only when the model provides some: a third-party module pinning the exact keyword list without **
tests/base/test_model.py:2047
Method
test_three_elements_not_pair
(self)
tests/base/test_modality.py:1319
Method
test_three_tuple_for_wide_lookup
(self)
tests/util/test_dataset.py:248
Method
test_threshold_is_exclusive
(self, kwargs)
tests/multi_vector_encoder/modules/test_token_pooling.py:491
Function
test_tie_encoder_decoder_does_not_raise
Regression for #3737: tying raised a RuntimeError on transformers>=5.0.0, which removed the ``PreTrainedModel._tie_encoder_decoder_weights`` helpe
tests/sentence_transformer/losses/test_denoising_auto_encoder.py:18
← previous
next →
4,201–4,300 of 4,575, ranked by callers