MCPcopy Create free account

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

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

Functiontest_sparse_static_embedding_loads_json_checkpoint
(tmp_path: Path, explicit_cache_folder: bool)
tests/sparse_encoder/modules/test_sparse_static_embedding.py:87
Functiontest_sparse_static_embedding_padding_ignored
(inference_free_splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/modules/test_sparse_static_embedding.py:16
Functiontest_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
Functiontest_sparsity
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_model.py:424
Functiontest_splade_configuration_mismatch
(splade_bert_tiny_model, problem)
tests/test_merging.py:435
Functiontest_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
Functiontest_splade_loss_merged_forward_matches_per_column
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/losses/test_merged_forward.py:52
Functiontest_splade_pooling_chunk_size
(splade_bert_tiny_model: SparseEncoder)
tests/sparse_encoder/test_model.py:446
Functiontest_splade_pooling_dimension_metadata
(splade_bert_tiny_model, evaluated_first, dimension)
tests/test_merging.py:419
Functiontest_stacked_modifiers_cached_matches_non_cached
()
tests/multi_vector_encoder/losses/test_token_pooling.py:172
Functiontest_stacked_modifiers_fp16_padding_has_finite_gradients
(mve_bert_tiny_model, build_inner)
tests/multi_vector_encoder/losses/test_token_pooling.py:203
Functiontest_stacked_modifiers_match_encoding
(mve_bert_tiny_model, build_inner)
tests/multi_vector_encoder/losses/test_token_pooling.py:247
Methodtest_standard_hidden_size
(self, bert_tiny_transformer)
tests/base/modules/test_transformer.py:1137
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_static_openvino_quantization_config
(monkeypatch: pytest.MonkeyPatch, config_type: str)
tests/util/test_backend.py:32
Methodtest_str_modality
(self)
tests/base/test_modality.py:1131
Methodtest_string_encoded_integer_ids
(self)
tests/util/test_dataset.py:142
Methodtest_string_encoded_list_gets_a_hint
(self, documents: Dataset)
tests/util/test_dataset.py:316
Methodtest_string_ids_use_the_sorted_index
(self, documents: Dataset)
tests/util/test_dataset.py:452
Methodtest_string_keep_columns_rejected
(self, documents: Dataset)
tests/util/test_dataset.py:301
Methodtest_string_not_pair
(self)
tests/base/test_modality.py:1322
Functiontest_string_positive
Positive as a string (not list) is handled correctly.
tests/cross_encoder/evaluation/test_reranking.py:86
Methodtest_string_prompt
(self)
tests/base/test_data_collator.py:95
Methodtest_string_prompt_returns_for_any_column
(self)
tests/base/test_data_collator.py:126
Methodtest_structured_cross_modality
(self)
tests/base/test_modality.py:1372
Methodtest_structured_format
(self)
tests/base/test_modality.py:1194
Methodtest_structured_multimodal
(self)
tests/base/test_modality.py:488
Methodtest_structured_multimodal_preserves_dict_ordering
Content items should follow the input dict's key order, not alphabetical.
tests/base/test_modality.py:497
Methodtest_structured_same_modality
(self)
tests/base/test_modality.py:1361
Methodtest_structured_single_modality
(self)
tests/base/test_modality.py:483
Methodtest_structured_template_with_type_pattern
(self)
tests/base/test_modality.py:440
Methodtest_structured_text_implicit_type
Structured items without an explicit 'type' key default to text.
tests/base/test_modality.py:1517
Methodtest_structured_text_only
Structured format messages with only text items are text-only.
tests/base/test_modality.py:1512
Methodtest_structured_to_flat_multi_item_keeps_structured
(self)
tests/base/test_modality.py:529
Methodtest_structured_to_flat_single_text
(self)
tests/base/test_modality.py:523
Methodtest_structured_with_audio
Messages containing an audio item are not text-only.
tests/base/test_modality.py:1537
Methodtest_structured_with_image
Messages containing an image item are not text-only.
tests/base/test_modality.py:1522
Methodtest_suffix_stripping_single_columns
(self, documents: Dataset, input_col: str, output_col: str)
tests/util/test_dataset.py:224
Functiontest_suggest_extra_monkeypatch_missing_pillow
Simulate AutoProcessor.from_pretrained raising ImportError for missing Pillow.
tests/util/test_environment.py:85
Functiontest_suggest_extra_monkeypatch_missing_torchcodec
Simulate AutoProcessor.from_pretrained raising AttributeError for missing torchcodec.
tests/util/test_environment.py:98
Functiontest_suggest_extra_on_exception_adds_hint
( exception_cls: type[Exception], message: str, expected_snippet: str )
tests/util/test_environment.py:54
Functiontest_suggest_extra_on_exception_ignores_other_exceptions
()
tests/util/test_environment.py:74
Functiontest_suggest_extra_on_exception_no_exception
()
tests/util/test_environment.py:80
Functiontest_suggest_extra_on_exception_preserves_exception_type
()
tests/util/test_environment.py:62
Functiontest_suggest_extra_on_exception_reraises_unmatched
()
tests/util/test_environment.py:68
Methodtest_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
Functiontest_supports_parametrized
( monkeypatch: pytest.MonkeyPatch, stsb_bert_tiny_model: SentenceTransformer, modalities: list,
tests/base/test_model.py:403
Methodtest_system_messages_are_independent
Each message list should get its own system message dict (no shared mutable state).
tests/base/test_modality.py:1266
Functiontest_target_device_backwards_compat
()
tests/cross_encoder/test_model.py:452
Functiontest_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
Functiontest_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
Methodtest_task_outside_tasks_returns_input_unchanged
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:91
Methodtest_task_stamped_when_router_mapping_resolves
(self)
tests/base/test_data_collator.py:233
Methodtest_tasks_accepts_a_bare_string
(self)
tests/multi_vector_encoder/modules/test_token_pooling.py:564
Methodtest_tasks_round_trip_through_config
(self, tmp_path)
tests/multi_vector_encoder/modules/test_token_pooling.py:568
Methodtest_tensor_1d_is_audio
(self)
tests/base/test_modality.py:182
Methodtest_tensor_3d_is_image
(self)
tests/base/test_modality.py:185
Methodtest_tensor_4d_is_video
(self)
tests/base/test_modality.py:188
Methodtest_tensor_bad_ndim_raises
(self)
tests/base/test_modality.py:295
Methodtest_tensor_formatted_dataset_labels
(self, label_shape)
tests/base/test_data_collator.py:61
Functiontest_tensor_formatted_list_labels
()
tests/cross_encoder/test_data_collator.py:28
Functiontest_tensor_formatted_scalar_labels
(labels: list)
tests/cross_encoder/test_data_collator.py:14
Methodtest_tensor_text_pair
(self)
tests/base/test_modality.py:1312
Methodtest_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
Methodtest_text_and_image_collections_preserve_content_order
(self, container, text_count, images_first, paired)
tests/base/test_modality.py:1031
Methodtest_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
Methodtest_text_config_fallback
Should fall back to text_config.hidden_size when main config lacks it.
tests/base/modules/test_transformer.py:1172
Methodtest_text_custom_examples
usage_examples strings appear in the snippet.
tests/base/test_model_card.py:444
Methodtest_text_default_examples
Default examples are used when usage_examples is None.
tests/base/test_model_card.py:432
Methodtest_text_image_pair
(self)
tests/base/test_modality.py:1299
Methodtest_text_inputs
(self)
tests/base/test_modality.py:570
Methodtest_text_inputs_are_flattened
Text inputs should be flattened when can_flatten_inputs is True.
tests/base/modules/test_transformer.py:2320
Methodtest_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
Methodtest_text_modality_in_card
Text-only model shows 'Text' in supported modalities.
tests/base/test_model_card.py:996
Methodtest_text_model_card_valid
Text model generates a valid card with no triple newlines.
tests/base/test_model_card.py:977
Methodtest_text_model_id
model_id appears in the loading line, or a placeholder is used when None.
tests/base/test_model_card.py:482
Methodtest_text_model_roundtrip
(self, tmp_path: Path, model_name: str, expected_class_name: str, extra_kwargs: dict)
tests/base/modules/test_transformer.py:2130
Methodtest_text_only
(self)
tests/base/modules/test_transformer.py:2425
Methodtest_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
Methodtest_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
Methodtest_text_only_model_skips
Text-only model does not produce multimodal usage_examples.
tests/base/test_model_card.py:645
Methodtest_text_only_sample_omits_image_inputs
(self, features)
tests/sentence_transformer/losses/test_cmnrl.py:368
Methodtest_text_output_dimensionality
Embedding dimension appears in the shape comment.
tests/base/test_model_card.py:491
Methodtest_text_pair_inputs
(self)
tests/base/test_modality.py:576
Methodtest_text_pair_is_not_non_text
(self)
tests/base/test_modality.py:1289
Methodtest_text_pair_list
(self)
tests/base/test_modality.py:145
Methodtest_text_pair_list_is_not_non_text
(self)
tests/base/test_modality.py:1292
Methodtest_text_pair_tuple
(self)
tests/base/test_modality.py:142
Methodtest_text_pairs
(self)
tests/base/test_modality.py:1231
Methodtest_text_pairs_stay_as_text
Text pairs should be detected as 'text' modality (tokenizer handles natively).
tests/base/test_modality.py:1433
Methodtest_text_text_pair
(self)
tests/base/test_modality.py:1393
Methodtest_text_with_similarities
When similarities are computed, they appear in the snippet.
tests/base/test_model_card.py:455
Methodtest_text_without_similarities
When no similarities, shape comment is shown.
tests/base/test_model_card.py:465
Functiontest_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
Methodtest_three_elements_not_pair
(self)
tests/base/test_modality.py:1319
Methodtest_three_tuple_for_wide_lookup
(self)
tests/util/test_dataset.py:248
Methodtest_threshold_is_exclusive
(self, kwargs)
tests/multi_vector_encoder/modules/test_token_pooling.py:491
Functiontest_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
← previousnext →4,201–4,300 of 4,575, ranked by callers