Repository Analysis

huggingface/transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

27.0 Moderate AI signal View on GitHub
27.0
Adjusted Score
27.0
Raw Score
100%
Time Factor
2026-05-30
Last Push
161,059
Stars
Python
Language
1,867,474
Lines of Code
5880
Files
28669
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 21HIGH 5233MEDIUM 755LOW 22660

Pattern Findings

28669 matches across 20 categories. Click a row to expand file-level details.

Cross-File Repetition5136 hits · 25680 pts
SeverityFileLineSnippet
HIGHtests/test_tokenization_common.py0this is a test 😊 i was born in 92000, and this is falsé. 生活的真谛是 hi hello hi hello hello <s> hi<s>there the following str
HIGHtests/test_tokenization_common.py0this is a test 😊 i was born in 92000, and this is falsé. 生活的真谛是 hi hello hi hello hello <s> hi<s>there the following str
HIGHtests/test_tokenizers_backend_mixin.py0this is a test 😊 i was born in 92000, and this is falsé. 生活的真谛是 hi hello hi hello hello <s> hi<s>there the following str
HIGHtests/test_tokenization_common.py0test that passing pad_token when creating a tokenizer works correctly.
HIGHtests/models/udop/test_tokenization_udop.py0test that passing pad_token when creating a tokenizer works correctly.
HIGHtests/models/layoutxlm/test_tokenization_layoutxlm.py0test that passing pad_token when creating a tokenizer works correctly.
HIGHtests/test_modeling_common.py0tests the equivalence between the eager and flash attention implementations. this test is only for inference and runs wi
HIGHtests/models/sam3_tracker/test_modeling_sam3_tracker.py0tests the equivalence between the eager and flash attention implementations. this test is only for inference and runs wi
HIGHtests/models/sam2/test_modeling_sam2.py0tests the equivalence between the eager and flash attention implementations. this test is only for inference and runs wi
HIGHtests/test_modeling_common.py0tests if composite models dispatch correctly on sdpa/eager when requested so when loading the model. this tests only by
HIGHtests/models/blip_2/test_modeling_blip_2.py0tests if composite models dispatch correctly on sdpa/eager when requested so when loading the model. this tests only by
HIGHtests/models/blip_2/test_modeling_blip_2.py0tests if composite models dispatch correctly on sdpa/eager when requested so when loading the model. this tests only by
HIGHtests/models/sam/test_modeling_sam.py0tests if composite models dispatch correctly on sdpa/eager when requested so when loading the model. this tests only by
HIGHtests/models/sam3_tracker/test_modeling_sam3_tracker.py0tests if composite models dispatch correctly on sdpa/eager when requested so when loading the model. this tests only by
HIGHtests/models/instructblip/test_modeling_instructblip.py0tests if composite models dispatch correctly on sdpa/eager when requested so when loading the model. this tests only by
HIGHtests/models/sam2/test_modeling_sam2.py0tests if composite models dispatch correctly on sdpa/eager when requested so when loading the model. this tests only by
HIGHtests/test_processing_common.py0this function prepares a list of pil images for testing
HIGHtests/models/mllama/test_processing_mllama.py0this function prepares a list of pil images for testing
HIGH…/models/video_llama_3/test_processing_video_llama_3.py0this function prepares a list of pil images for testing
HIGHtests/models/gemma3/test_processing_gemma3.py0this function prepares a list of pil images for testing
HIGHtests/models/gemma4/test_processing_gemma4.py0this function prepares a list of pil images for testing
HIGHtests/models/lfm2_vl/test_processing_lfm2_vl.py0this function prepares a list of pil images for testing
HIGHtests/models/smolvlm/test_processing_smolvlm.py0this function prepares a list of pil images for testing
HIGHtests/test_processing_common.py0we use do_rescale=true, rescale_factor=-1.0 to ensure that image_processor kwargs are preserved in the processor. we the
HIGHtests/test_processing_common.py0we use do_rescale=true, rescale_factor=-1.0 to ensure that image_processor kwargs are preserved in the processor. we the
HIGHtests/models/colqwen2/test_processing_colqwen2.py0we use do_rescale=true, rescale_factor=-1.0 to ensure that image_processor kwargs are preserved in the processor. we the
HIGHtests/models/colpali/test_processing_colpali.py0we use do_rescale=true, rescale_factor=-1.0 to ensure that image_processor kwargs are preserved in the processor. we the
HIGH…odels/colmodernvbert/test_processing_colmodernvbert.py0we use do_rescale=true, rescale_factor=-1.0 to ensure that image_processor kwargs are preserved in the processor. we the
HIGHtests/test_image_processing_common.py0this function prepares a list of pil images, or a list of numpy arrays if one specifies numpify=true, or a list of pytor
HIGHtests/models/mllama/test_image_processing_mllama.py0this function prepares a list of pil images, or a list of numpy arrays if one specifies numpify=true, or a list of pytor
HIGHtests/models/aria/test_image_processing_aria.py0this function prepares a list of pil images, or a list of numpy arrays if one specifies numpify=true, or a list of pytor
HIGHtests/models/idefics3/test_image_processing_idefics3.py0this function prepares a list of pil images, or a list of numpy arrays if one specifies numpify=true, or a list of pytor
HIGHtests/models/smolvlm/test_image_processing_smolvlm.py0this function prepares a list of pil images, or a list of numpy arrays if one specifies numpify=true, or a list of pytor
HIGHtests/test_image_processing_common.py0test that explicitly setting an attribute to none is preserved through save/load.
HIGHtests/test_video_processing_common.py0test that explicitly setting an attribute to none is preserved through save/load.
HIGHtests/models/mllama/test_image_processing_mllama.py0test that explicitly setting an attribute to none is preserved through save/load.
HIGHtests/causal_lm_tester.py0tests the frequency properties of the different rope scaling types on the model rope layer.
HIGHtests/models/olmo3/test_modeling_olmo3.py0tests the frequency properties of the different rope scaling types on the model rope layer.
HIGHtests/models/gemma3/test_modeling_gemma3.py0tests the frequency properties of the different rope scaling types on the model rope layer.
HIGHtests/models/gemma3n/test_modeling_gemma3n.py0tests the frequency properties of the different rope scaling types on the model rope layer.
HIGH…modernbert_decoder/test_modeling_modernbert_decoder.py0tests the frequency properties of the different rope scaling types on the model rope layer.
HIGHtests/models/eurobert/test_modeling_eurobert.py0tests the frequency properties of the different rope scaling types on the model rope layer.
HIGHtests/test_video_processing_common.py0tests that the processor can work with nested list where each video is a list of arrays
HIGH…nie4_5_vl_moe/test_video_processing_ernie4_5_vl_moe.py0tests that the processor can work with nested list where each video is a list of arrays
HIGHtests/models/glm46v/test_video_processing_glm46v.py0tests that the processor can work with nested list where each video is a list of arrays
HIGH…s/video_llama_3/test_video_processing_video_llama_3.py0tests that the processor can work with nested list where each video is a list of arrays
HIGHtests/models/glmga/test_video_processing_glmga.py0tests that the processor can work with nested list where each video is a list of arrays
HIGHtests/models/qwen2_vl/test_video_processing_qwen2_vl.py0tests that the processor can work with nested list where each video is a list of arrays
HIGHtests/models/glm4v/test_video_processing_glm4v.py0tests that the processor can work with nested list where each video is a list of arrays
HIGHtests/models/qwen3_vl/test_video_processing_qwen3_vl.py0tests that the processor can work with nested list where each video is a list of arrays
HIGHtests/utils/test_chat_template_utils.py0test function args: x: the input returns: the output
HIGHtests/utils/test_chat_template_utils.py0test function args: x: the input returns: the output
HIGHtests/utils/test_chat_template_utils.py0test function args: x: the input returns: the output
HIGHtests/utils/test_chat_template_utils.py0test function args: x: the input returns: the output
HIGH…ts/models/edgetam_video/test_modeling_edgetam_video.py0test that inference works correctly for float32, bfloat16, and float16 dtypes.
HIGHtests/models/sam3_video/test_modeling_sam3_video.py0test that inference works correctly for float32, bfloat16, and float16 dtypes.
HIGH…sam3_tracker_video/test_modeling_sam3_tracker_video.py0test that inference works correctly for float32, bfloat16, and float16 dtypes.
HIGHtests/models/sam2_video/test_modeling_sam2_video.py0test that inference works correctly for float32, bfloat16, and float16 dtypes.
HIGHtests/models/biogpt/test_tokenization_biogpt.py0adapted from sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
HIGHtests/models/xlm/test_tokenization_xlm.py0adapted from sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
5076 more matches not shown…
Hyper-Verbose Identifiers13288 hits · 13235 pts
SeverityFileLineSnippet
LOWconftest.py105def pytest_collection_modifyitems(items):
LOWbenchmark/benchmarks_entrypoint.py146 def collect_device_measurements(self, benchmark_id: str, cpu_util, mem_megabytes, gpu_util, gpu_mem_megabytes):
LOWbenchmark/benchmarks_entrypoint.py179 def collect_model_measurements(self, benchmark_id: str, measurements: dict[str, float]):
LOWbenchmark/benchmarks_entrypoint.py378def create_database_connection():
LOWbenchmark/benchmarks_entrypoint.py397def create_global_metrics_recorder(
LOWbenchmark/benches/llama.py143 def multinomial_sample_one_no_sync(probs_sort): # Does multinomial sampling without a cuda synchronization
LOW…rk_v2/benchmark_scripts/continuous_batching_overall.py69def _build_lighteval_inputs_scorer(
LOWbenchmark_v2/framework/hardware_metrics.py30def get_device_name_and_memory_total() -> tuple[str, float]:
LOWbenchmark_v2/framework/benchmark_runner.py59def compact_json_numeric_arrays(data: dict):
LOWbenchmark_v2/framework/data_classes.py39def equalize_lengths_and_collate(stats: dict[str, dict[str, str]]) -> dict[str, str]:
LOWtests/test_tokenization_common.py135def merge_model_tokenizer_mappings(
LOWtests/test_tokenization_common.py477 def get_extracted_tokenizer_from_sentencepiece(self, reference_tokenizer=None):
LOWtests/test_tokenization_common.py497 def tokenizer_integration_test_util(
LOWtests/test_tokenization_common.py567 def assert_padded_input_match(self, input_r: list, input_p: list, max_length: int, pad_token_id: int):
LOWtests/test_tokenization_common.py577 def assert_batch_padded_input_match(
LOWtests/test_tokenization_common.py604 def convert_batch_to_list_format(batch_encode_plus_sequences):
LOWtests/test_tokenization_common.py613 def test_tokenize_special_tokens(self):
LOWtests/test_tokenization_common.py633 def test_model_input_names_signature(self):
LOWtests/test_tokenization_common.py644 def test_tokenizer_store_full_signature(self):
LOWtests/test_tokenization_common.py661 def test_tokenizers_common_properties(self):
LOWtests/test_tokenization_common.py693 def test_tokenizers_common_ids_setters(self):
LOWtests/test_tokenization_common.py726 def test_save_and_load_tokenizer(self):
LOWtests/test_tokenization_common.py859 def test_integration_from_extractor(self):
LOWtests/test_tokenization_common.py892 def test_internal_consistency(self):
LOWtests/test_tokenization_common.py1014 def test_chat_template_save_loading(self):
LOWtests/test_tokenization_common.py1056 def test_chat_template_batched(self):
LOWtests/test_tokenization_common.py1130 def test_chat_template_return_assistant_tokens_mask(self):
LOWtests/test_tokenization_common.py1323 def test_chat_template_return_assistant_tokens_mask_truncated(self):
LOWtests/test_tokenization_common.py1434 def test_continue_final_message(self):
LOWtests/test_tokenization_common.py1462 def test_continue_final_message_with_trim(self):
LOWtests/test_tokenization_common.py1492 def test_continue_final_message_with_decoy_earlier_message(self):
LOWtests/test_tokenization_common.py1517 def test_continue_final_message_string_and_reasoning(self):
LOWtests/test_tokenization_common.py1565 def test_chat_template_dict_saving(self):
LOWtests/test_tokenization_common.py1596 def test_chat_template_dict_saving_rejects_path_traversal(self):
LOWtests/test_tokenization_common.py1613 def test_chat_template_file_priority(self):
LOWtests/test_tokenization_common.py1626 def test_number_of_added_tokens(self):
LOWtests/test_tokenization_common.py1638 def test_maximum_encoding_length_single_input(self):
LOWtests/test_tokenization_common.py1733 def test_maximum_encoding_length_pair_input(self):
LOWtests/test_tokenization_common.py2006 def test_special_tokens_mask_input_pairs(self):
LOWtests/test_tokenization_common.py2029 def test_padding_side_in_kwargs(self):
LOWtests/test_tokenization_common.py2046 def test_truncation_side_in_kwargs(self):
LOWtests/test_tokenization_common.py2063 def test_encode_basic_padding(self):
LOWtests/test_tokenization_common.py2092 def test_right_and_left_truncation(self):
LOWtests/test_tokenization_common.py2146 def test_padding_to_multiple_of(self):
LOWtests/test_tokenization_common.py2178 def test_padding_with_attention_mask(self):
LOWtests/test_tokenization_common.py2196 def test_encode_plus_with_padding(self, use_padding_as_call_kwarg: bool):
LOWtests/test_tokenization_common.py2321 def test_conversion_reversible(self):
LOWtests/test_tokenization_common.py2359 def test_batch_encode_plus_batch_sequence_length(self):
LOWtests/test_tokenization_common.py2407 def test_batch_encode_plus_padding(self):
LOWtests/test_tokenization_common.py2521 def _check_no_pad_token_padding(self, tokenizer, sequences):
LOWtests/test_tokenization_common.py2575 def test_batch_encode_dynamic_overflowing(self):
LOWtests/test_tokenization_common.py2638 def test_added_tokens_serialization(self):
LOWtests/test_tokenization_common.py2665 def test_tokenizer_initialization_with_conflicting_key(self):
LOWtests/test_tokenization_common.py2700 def test_pad_token_initialization(self):
LOWtests/test_tokenization_common.py2733 def test_bos_token_with_add_bos_token_true(self):
LOWtests/test_tokenization_common.py2750 def test_bos_token_with_add_bos_token_false(self):
LOWtests/test_tokenization_common.py2836 def test_add_tokens_tokenizer(self):
LOWtests/test_modeling_common.py1742 def test_training_gradient_checkpointing(self):
LOWtests/test_modeling_common.py1746 def test_training_gradient_checkpointing_use_reentrant_false(self):
LOWtests/test_modeling_common.py1751 def test_training_gradient_checkpointing_use_reentrant_true(self):
13228 more matches not shown…
Over-Commented Block3867 hits · 3778 pts
SeverityFileLineSnippet
LOWconftest.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWsetup.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOWbenchmark/benchmark.py1# Copyright 2024 The HuggingFace Team. All rights reserved.
LOWbenchmark/benchmarks_entrypoint.py1# Copyright 2025 The HuggingFace Team. All rights reserved.
LOWbenchmark/benches/llama.py1# Copyright 2025 The HuggingFace Team. All rights reserved.
LOWbenchmark_v2/run_benchmarks.py1#!/usr/bin/env python3
LOWtests/test_tokenization_common.py1# Copyright 2019 HuggingFace Inc.
LOWtests/test_modeling_common.py1# Copyright 2019 HuggingFace Inc.
LOWtests/test_configuration_common.py1# Copyright 2019 HuggingFace Inc.
LOWtests/multimodal_tester.py1# Copyright 2026 HuggingFace Inc.
LOWtests/test_tensor_parallel_mixin.py1#
LOWtests/test_monkey_patching.py1# Copyright 2026 The HuggingFace Inc. team.
LOWtests/test_processing_common.py1# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
LOWtests/test_backbone_common.py1# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
LOWtests/test_image_processing_common.py1# Copyright 2023 HuggingFace Inc.
LOWtests/causal_lm_tester.py1# Copyright 2025 HuggingFace Inc.
LOWtests/test_executorch.py1# Copyright 2025 HuggingFace Inc.
LOWtests/test_feature_extraction_common.py1# Copyright 2021 HuggingFace Inc.
LOWtests/alm_tester.py1# Copyright 2026 HuggingFace Inc.
LOWtests/test_video_processing_common.py1# Copyright 2025 HuggingFace Inc.
LOWtests/test_pipeline_mixin.py1# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
LOWtests/test_tokenization_mistral_common.py1# Copyright 2025 Mistral AI and The HuggingFace Inc. team. All rights reserved.
LOWtests/vlm_tester.py1# Copyright 2026 HuggingFace Inc.
LOWtests/test_training_mixin.py1# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
LOWtests/test_sequence_feature_extraction_common.py1# Copyright 2021 HuggingFace Inc.
LOWtests/test_image_transforms.py1# Copyright 2022 HuggingFace Inc.
LOWtests/kernels/test_kernels.py1# Copyright 2025 The HuggingFace Team. All rights reserved.
LOWtests/tensor_parallel/test_tensor_parallel.py1# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
LOWtests/peft_integration/test_peft_integration.py1# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
LOWtests/optimization/test_greedy_lr.py1# Copyright 2026 The HuggingFace Team. All rights reserved.
LOWtests/optimization/test_optimization.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOW…s/pipelines/test_pipelines_image_feature_extraction.py1# Copyright 2024 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_object_detection.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_common.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_text_classification.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_token_classification.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_image_text_to_text.py1# Copyright 2024 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_zero_shot.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_depth_estimation.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_mask_generation.py1# Copyright 2023 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_text_generation.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_text_to_audio.py1# Copyright 2023 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_feature_extraction.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOW…ipelines/test_pipelines_document_question_answering.py1# Copyright 2022 The HuggingFace Team. All rights reserved.
LOW…pelines/test_pipelines_automatic_speech_recognition.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_image_classification.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOW…pipelines/test_pipelines_zero_shot_object_detection.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOW…lines/test_pipelines_zero_shot_image_classification.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOW…lines/test_pipelines_zero_shot_image_classification.py41
LOW…s/pipelines/test_pipelines_table_question_answering.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_image_segmentation.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOW…lines/test_pipelines_zero_shot_audio_classification.py1# Copyright 2023 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_keypoint_matching.py1# Copyright 2025 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_fill_mask.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_audio_classification.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_video_classification.py1# Copyright 2021 The HuggingFace Team. All rights reserved.
LOWtests/pipelines/test_pipelines_any_to_any.py1# Copyright 2025 The HuggingFace Team. All rights reserved.
LOWtests/utils/test_activations.py1# Copyright 2020 The HuggingFace Team. All rights reserved.
LOWtests/utils/test_deprecation.py1# Copyright 2024 The HuggingFace Team. All rights reserved.
LOWtests/utils/test_fusion_mapping.py1# Copyright 2026 The HuggingFace Inc. team.
3807 more matches not shown…
Unused Imports3143 hits · 2550 pts
SeverityFileLineSnippet
LOWbenchmark_v2/framework/benchmark_config.py17
LOWtests/test_tokenization_common.py85
LOWtests/test_tokenization_common.py85
LOW…ipelines/test_pipelines_document_question_answering.py43
LOW…pipelines/test_pipelines_zero_shot_object_detection.py35
LOWtests/utils/test_file_utils.py23
LOWtests/models/mistral4/__init__.py17
LOWtests/models/mistral4/__init__.py17
LOWtests/models/opt/test_modeling_opt.py20
LOWtests/models/fsmt/test_modeling_fsmt.py19
LOWtests/tokenization/test_tokenization_utils.py281
LOWutils/check_import_complexity.py27
LOW…amples/modular-transformers/modular_switch_function.py2
LOWsrc/transformers/image_utils.py36
LOWsrc/transformers/image_utils.py36
LOWsrc/transformers/image_utils.py36
LOWsrc/transformers/image_utils.py36
LOWsrc/transformers/image_utils.py36
LOWsrc/transformers/image_utils.py36
LOWsrc/transformers/modeling_rope_utils.py31
LOWsrc/transformers/pytorch_utils.py14
LOWsrc/transformers/_typing.py16
LOWsrc/transformers/trainer_seq2seq.py36
LOWsrc/transformers/trainer_seq2seq.py39
LOWsrc/transformers/trainer_seq2seq.py41
LOWsrc/transformers/trainer_seq2seq.py42
LOWsrc/transformers/trainer_seq2seq.py43
LOWsrc/transformers/trainer_seq2seq.py44
LOWsrc/transformers/trainer_seq2seq.py45
LOWsrc/transformers/trainer_seq2seq.py46
LOWsrc/transformers/trainer_seq2seq.py47
LOWsrc/transformers/trainer_seq2seq.py48
LOWsrc/transformers/trainer_seq2seq.py48
LOWsrc/transformers/trainer_seq2seq.py49
LOWsrc/transformers/feature_extraction_utils.py47
LOWsrc/transformers/tokenization_utils_base.py21
LOWsrc/transformers/core_model_loading.py16
LOWsrc/transformers/safetensors_conversion.py4
LOWsrc/transformers/processing_utils.py80
LOWsrc/transformers/processing_utils.py85
LOWsrc/transformers/trainer_optimizer.py18
LOWsrc/transformers/optimization.py16
LOWsrc/transformers/__init__.py30
LOWsrc/transformers/__init__.py31
LOWsrc/transformers/__init__.py31
LOWsrc/transformers/__init__.py31
LOWsrc/transformers/__init__.py31
LOWsrc/transformers/__init__.py31
LOWsrc/transformers/__init__.py31
LOWsrc/transformers/__init__.py46
LOWsrc/transformers/__init__.py47
LOWsrc/transformers/__init__.py49
LOWsrc/transformers/__init__.py50
LOWsrc/transformers/__init__.py53
LOWsrc/transformers/__init__.py485
LOWsrc/transformers/__init__.py485
LOWsrc/transformers/__init__.py486
LOWsrc/transformers/__init__.py487
LOWsrc/transformers/__init__.py488
LOWsrc/transformers/__init__.py489
3083 more matches not shown…
Deep Nesting1622 hits · 1461 pts
SeverityFileLineSnippet
LOWbenchmark/benchmark.py60
LOWbenchmark_v2/framework/hardware_metrics.py184
LOWbenchmark_v2/framework/benchmark_runner.py82
LOWbenchmark_v2/framework/benchmark_runner.py443
LOWbenchmark_v2/framework/data_classes.py21
LOWbenchmark_v2/framework/benchmark_config.py255
LOWtests/test_tokenization_common.py135
LOWtests/test_tokenization_common.py225
LOWtests/test_tokenization_common.py1130
LOWtests/test_tokenization_common.py1323
LOWtests/test_tokenization_common.py1638
LOWtests/test_tokenization_common.py1733
LOWtests/test_tokenization_common.py2638
LOWtests/test_modeling_common.py160
LOWtests/test_modeling_common.py558
LOWtests/test_modeling_common.py724
LOWtests/test_modeling_common.py894
LOWtests/test_modeling_common.py930
LOWtests/test_modeling_common.py1118
LOWtests/test_modeling_common.py1483
LOWtests/test_modeling_common.py1629
LOWtests/test_modeling_common.py2038
LOWtests/test_modeling_common.py2299
LOWtests/test_modeling_common.py2497
LOWtests/test_modeling_common.py2523
LOWtests/test_modeling_common.py2567
LOWtests/test_modeling_common.py2640
LOWtests/test_modeling_common.py2698
LOWtests/test_modeling_common.py2988
LOWtests/test_modeling_common.py3031
LOWtests/test_modeling_common.py3069
LOWtests/test_modeling_common.py3115
LOWtests/test_modeling_common.py3159
LOWtests/test_modeling_common.py3261
LOWtests/test_modeling_common.py3474
LOWtests/test_modeling_common.py3534
LOWtests/test_modeling_common.py3571
LOWtests/test_modeling_common.py3653
LOWtests/test_modeling_common.py3740
LOWtests/test_modeling_common.py3802
LOWtests/test_modeling_common.py3901
LOWtests/test_modeling_common.py4173
LOWtests/test_modeling_common.py4517
LOWtests/test_modeling_common.py4560
LOWtests/test_modeling_common.py4685
LOWtests/test_modeling_common.py4753
LOWtests/test_modeling_common.py5190
LOWtests/test_modeling_common.py5351
LOWtests/test_modeling_common.py5492
LOWtests/test_modeling_common.py5625
LOWtests/test_modeling_common.py1491
LOWtests/test_modeling_common.py2705
LOWtests/test_modeling_common.py4207
LOWtests/test_modeling_common.py2710
LOWtests/test_modeling_common.py3365
LOWtests/test_configuration_common.py94
LOWtests/test_configuration_common.py187
LOWtests/test_tensor_parallel_mixin.py131
LOWtests/test_tensor_parallel_mixin.py192
LOWtests/test_processing_common.py314
1562 more matches not shown…
Decorative Section Separators417 hits · 1322 pts
SeverityFileLineSnippet
MEDIUMtests/test_tensor_parallel_mixin.py425 # ============================================================
MEDIUMtests/test_tensor_parallel_mixin.py427 # ============================================================
MEDIUMtests/test_tensor_parallel_mixin.py438 # ============================================================
MEDIUMtests/test_tensor_parallel_mixin.py440 # ============================================================
MEDIUMtests/test_pipeline_mixin.py410 # ---------------------------------------------------------
MEDIUMtests/test_training_mixin.py42 # ============================================================
MEDIUMtests/test_training_mixin.py44 # ============================================================
MEDIUMtests/test_training_mixin.py61 # ============================================================
MEDIUMtests/test_training_mixin.py63 # ============================================================
MEDIUMtests/test_training_mixin.py77 # ============================================================
MEDIUMtests/test_training_mixin.py79 # ============================================================
MEDIUMtests/utils/test_auto_docstring.py673# ---------------------------------------------------------------------------
MEDIUMtests/utils/test_auto_docstring.py675# ---------------------------------------------------------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py151# ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py153# ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py289 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py291 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py258 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py260 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py441 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py443 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py454 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py456 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py331 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py333 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py369 # ------------------------
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py371 # ------------------------
MEDIUMtests/trainer/test_trainer_callback.py234 # -------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_callback.py236 # -------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_callback.py320 # -------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_callback.py322 # -------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_callback.py441 # -------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_callback.py443 # -------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_callback.py56# =============================================================================
MEDIUMtests/trainer/test_trainer_callback.py58# =============================================================================
MEDIUMtests/trainer/test_trainer_callback.py168# =============================================================================
MEDIUMtests/trainer/test_trainer_callback.py170# =============================================================================
MEDIUMtests/trainer/test_trainer_callback.py184# =============================================================================
MEDIUMtests/trainer/test_trainer_callback.py186# =============================================================================
MEDIUMtests/trainer/test_trainer_optimizers.py244 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py246 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py253 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py255 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py263 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py265 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py410 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py412 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py448 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py450 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py500 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py502 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py527 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py529 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py78 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py80 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py158 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py160 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py186 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py188 # ---------------------------------------------------------------------------
MEDIUMtests/trainer/test_trainer_optimizers.py221 # ---------------------------------------------------------------------------
357 more matches not shown…
Self-Referential Comments273 hits · 730 pts
SeverityFileLineSnippet
MEDIUMbenchmark/benchmarks_entrypoint.py428 # Create a global metrics recorder
MEDIUMbenchmark_v2/framework/data_classes.py150 # Create a new instance and accumulate the data
MEDIUMtests/test_monkey_patching.py155 # Create a dummy module in transformers namespace for testing
MEDIUMtests/test_processing_common.py1099 # Define the kwargs for each modality
MEDIUMtests/test_processing_common.py1122 # Define the kwargs for each modality
MEDIUMtests/test_processing_common.py1257 # Define the kwargs for each modality
MEDIUMtests/test_processing_common.py1448 # Define the kwargs for each modality
MEDIUMtests/test_processing_common.py1471 # Define the kwargs for each modality
MEDIUMtests/test_tokenizers_backend_mixin.py383 # Create a new mapping from the special tokens defined in the original tokenizer
MEDIUMtests/test_training_mixin.py87 # Create a deterministic sequence (not random, so model can learn it)
MEDIUMtests/kernels/test_kernels.py489 # Create a mock model on CUDA device
MEDIUMtests/kernels/test_kernels.py524 # Create a mock model
MEDIUMtests/peft_integration/test_peft_integration.py1292 # Create a temporary directory with a complete adapter model structure
MEDIUMtests/optimization/test_greedy_lr.py193 # Create a new scheduler and load state
MEDIUMtests/pipelines/test_pipelines_common.py242 # Create a temporary directory with a complete adapter model structure
MEDIUMtests/utils/test_masking_utils.py253 # Create a new input after the prefill
MEDIUMtests/models/udop/test_tokenization_udop.py133 # # Create a minimal mock tokenizer for the converter
MEDIUMtests/models/udop/test_tokenization_udop.py1240 # Create a new mapping from the special tokens defined in the original tokenizer
MEDIUMtests/models/flava/test_modeling_flava.py1147 # Create a clone of the input_ids tensor that will be its masked version
MEDIUMtests/models/flava/test_modeling_flava.py1195 # Create a clone of the input_ids tensor that will be its masked version
MEDIUM…cohere2_vision/test_image_processing_cohere2_vision.py208 # Create a 2:3 aspect ratio image (2 rows x 3 columns of patches)
MEDIUMtests/models/gpt_oss/test_modeling_gpt_oss.py300 # Create a temp file that calls the worker
MEDIUMtests/models/lighton_ocr/test_modeling_lighton_ocr.py507 # Create a small config for fast testing
MEDIUM…ts/models/superglue/test_image_processing_superglue.py410 # Create a specific scenario with intentional padding issues
MEDIUM…ts/models/superglue/test_image_processing_superglue.py429 # Create a match that points to a padded keypoint in image 1
MEDIUM…ts/models/superglue/test_image_processing_superglue.py434 # Create a valid match for comparison
MEDIUMtests/models/pix2struct/test_processing_pix2struct.py167 # Define the kwargs for each modality
MEDIUMtests/models/pix2struct/test_processing_pix2struct.py196 # Define the kwargs for each modality
MEDIUMtests/models/markuplm/test_tokenization_markuplm.py1245 # Create a new mapping from the special tokens defined in the original tokenizer
MEDIUMtests/models/colqwen2/test_processing_colqwen2.py241 # Define the kwargs for each modality
MEDIUMtests/models/colqwen2/test_processing_colqwen2.py261 # Define the kwargs for each modality
MEDIUMtests/models/nemotron_h/test_modeling_nemotron_h.py735 # Create a legacy config.json
MEDIUMtests/models/auto/test_video_processing_auto.py85 # Create a dummy config file with image_processor_type
MEDIUMtests/models/auto/test_image_processing_auto.py102 # Create a dummy config file with image_processor_type
MEDIUMtests/models/auto/test_modeling_auto.py576 # Create a temporary directory with a complete adapter model structure
MEDIUMtests/models/kosmos2_5/test_processor_kosmos2_5.py199 # Define the kwargs for each modality
MEDIUMtests/models/kosmos2_5/test_processor_kosmos2_5.py228 # Define the kwargs for each modality
MEDIUM…ts/models/oneformer/test_image_processing_oneformer.py351 # Create a temporary json file
MEDIUMtests/models/layoutlmv2/test_tokenization_layoutlmv2.py1284 # Create a new mapping from the special tokens defined in the original tokenizer
MEDIUMtests/models/layoutlmv3/test_tokenization_layoutlmv3.py1330 # Create a new mapping from the special tokens defined in the original tokenizer
MEDIUMtests/models/kosmos2/test_processing_kosmos2.py412 # Define the kwargs for each modality
MEDIUMtests/models/kosmos2/test_processing_kosmos2.py438 # Define the kwargs for each modality
MEDIUMtests/models/colpali/test_processing_colpali.py246 # Define the kwargs for each modality
MEDIUMtests/models/colpali/test_processing_colpali.py266 # Define the kwargs for each modality
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py294 # Create a small image (256x256)
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py312 # Create a small image that won't exceed the max_image_tokens threshold
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py328 # Create a large image (2048x2048)
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py347 # Create a large image that will require tiling
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py397 # Create a landscape image (1920x1080, ~16:9 aspect ratio)
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py416 # Create an extremely wide image (3000x500)
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py435 # Create an extremely tall image (500x3000)
MEDIUMtests/models/lfm2_vl/test_image_processing_lfm2_vl.py372 # Create a large image that will require tiling
MEDIUMtests/models/janus/test_processing_janus.py358 # Create a simple text message for testing
MEDIUM…modernbert_decoder/test_modeling_modernbert_decoder.py192 # Create a longer input to test sliding window attention
MEDIUM…odels/encoder_decoder/test_modeling_encoder_decoder.py787 # Create a new attention mask that ignores padding, and test that the loss differs for this new attention mask
MEDIUMtests/models/idefics/test_modeling_idefics.py180 # Create a list of configs and inputs, to test 2 things:
MEDIUMtests/models/moshi/test_tokenization_moshi.py219 # Create a new mapping from the special tokens defined in the original tokenizer
MEDIUMtests/models/csm/test_modeling_csm.py296 # Creating a 4D mask where each of the last 3 tokens do not attend to each other.
MEDIUMtests/models/csm/test_modeling_csm.py316 # Creating a position_ids tensor. note the repeating figures in the end.
MEDIUMtests/models/layoutxlm/test_tokenization_layoutxlm.py1443 # Create a new mapping from the special tokens defined in the original tokenizer
213 more matches not shown…
Docstring Block Structure74 hits · 370 pts
SeverityFileLineSnippet
HIGHsrc/transformers/configuration_utils.py567 Instantiate a [`PreTrainedConfig`] (or a derived class) from a pretrained model configuration. Args:
HIGHsrc/transformers/pytorch_utils.py132 This function chunks the `input_tensors` into smaller input tensor parts of size `chunk_size` over the dimension
HIGHsrc/transformers/feature_extraction_utils.py297 Instantiate a type of [`~feature_extraction_utils.FeatureExtractionMixin`] from a feature extractor, *e.g.* a
HIGHsrc/transformers/tokenization_utils_base.py1114 Add a dictionary of special tokens (eos, pad, cls, etc.) to the encoder and link them to class attributes. If
HIGHsrc/transformers/tokenization_utils_base.py1219 #TODO remove this from here! PreTrainedTOkeniuzerBase should be agnostic of AddedToken. Add a list of
HIGHsrc/transformers/trainer_utils.py76 Extract the base model from a PEFT-wrapped model. If the model is not a PEFT model, returns it unchanged. Othe
HIGHsrc/transformers/image_processing_base.py95 Instantiate a type of [`~image_processing_utils.ImageProcessingMixin`] from an image processor. Args:
HIGHsrc/transformers/tokenization_python.py517 Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to
HIGHsrc/transformers/tokenization_python.py1297 Create a mask from the two sequences passed to be used in a sequence-pair classification task. This me
HIGHsrc/transformers/dynamic_module_utils.py533 Extracts a class from a module file, present in the local folder or repository of a model. <Tip warning={true}
HIGHsrc/transformers/tokenization_utils_sentencepiece.py111 Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to
HIGHsrc/transformers/video_processing_utils.py430 Instantiate a type of [`~video_processing_utils.VideoProcessorBase`] from an video processor. Args:
HIGHsrc/transformers/pipelines/__init__.py661 Utility factory method to build a [`Pipeline`]. A pipeline consists of: - One or more components for
HIGHsrc/transformers/utils/deprecation.py45 Function or method decorator to notify users about deprecated keyword arguments, replacing them with a new name if
HIGHsrc/transformers/utils/chat_template_utils.py247 This function generates a JSON schema for a given function, based on its docstring and type hints. This is most
HIGHsrc/transformers/utils/hub.py228 Tries to locate a file in a local folder and repo, downloads and cache it if necessary. Args: path_or_
HIGHsrc/transformers/utils/hub.py302 Tries to locate several files in a local folder and repo, downloads and cache them if necessary. Args:
HIGHsrc/transformers/models/cohere/tokenization_cohere.py192Create a Command-R tool-use prompt. Once rendered, the prompt instructs the model to generate a list of actions
HIGHsrc/transformers/models/cohere/tokenization_cohere.py304Create a Command-R grounded generation (aka RAG) prompt. Once rendered, the prompt instructs the model to gener
HIGHsrc/transformers/models/mllama/processing_mllama.py35 Generate a cross-attention token mask for image tokens in the input sequence. This function identifies the pos
HIGHsrc/transformers/models/mllama/processing_mllama.py131 Builds a string from the input prompt by adding `bos_token` if not already present. Args: prompt (`str
HIGHsrc/transformers/models/clvp/modeling_clvp.py1368 This method can be used to extract speech_embeds. The speech embeddings are obtained by applying the speech
HIGH…/conditional_detr/image_processing_conditional_detr.py122 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…ditional_detr/image_processing_pil_conditional_detr.py400 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…s/models/maskformer/image_processing_pil_maskformer.py240 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…rmers/models/maskformer/image_processing_maskformer.py89 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…formers/models/markuplm/feature_extraction_markuplm.py99 Main method to prepare for the model one or several HTML strings. Args: html_strings (`str
HIGH…/transformers/models/eomt/image_processing_pil_eomt.py185 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGHsrc/transformers/models/eomt/image_processing_eomt.py110 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…formers/models/esm/openfold_utils/residue_constants.py603Maps the given sequence into a one-hot encoded matrix. Args: sequence: An amino acid sequence. mapping:
HIGHsrc/transformers/models/auto/configuration_auto.py290 Instantiate one of the configuration classes of the library from a pretrained model configuration. The
HIGHsrc/transformers/models/auto/image_processing_auto.py210 Loads the image processor configuration from a pretrained model image processor configuration. Args: p
HIGHsrc/transformers/models/auto/video_processing_auto.py116 Loads the video processor configuration from a pretrained model video processor configuration. Args: p
HIGHsrc/transformers/models/auto/feature_extraction_auto.py133 Loads the feature extractor configuration from a pretrained model feature extractor configuration. Args:
HIGHsrc/transformers/models/auto/tokenization_auto.py481 Loads the tokenizer configuration from a pretrained model tokenizer configuration. Args: pretrained_mo
HIGH…/transformers/models/bertweet/tokenization_bertweet.py543 Remove entities from text by converting them to their corresponding unicode character. Args: text:
HIGH…formers/models/oneformer/image_processing_oneformer.py185 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…ers/models/oneformer/image_processing_pil_oneformer.py263 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…ers/models/mask2former/image_processing_mask2former.py121 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGH…models/mask2former/image_processing_pil_mask2former.py245 Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and
HIGHsrc/transformers/models/tapas/tokenization_tapas.py2583 Creates a function that can be used as a sort key or to compare the values. Maps to primitive types and finds the
HIGHsrc/transformers/models/blip/modeling_blip.py1092 Overrides *generate* function to be able to use the model as a conditional generator Parameters:
HIGH…ransformers/models/timesformer/modeling_timesformer.py490 Examples: ```python >>> import av >>> import numpy as np >>> from transformer
HIGH…ransformers/models/timesformer/modeling_timesformer.py621 labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the image cl
HIGHsrc/transformers/models/patchtst/modeling_patchtst.py1107 Parameters: past_values (`torch.Tensor` of shape `(bs, sequence_length, num_input_channels)`, *requ
HIGHsrc/transformers/models/patchtst/modeling_patchtst.py1244 Parameters: past_values (`torch.Tensor` of shape `(bs, sequence_length, num_input_channels)`, *requ
HIGHsrc/transformers/models/patchtst/modeling_patchtst.py1612 Parameters: past_values (`torch.Tensor` of shape `(bs, sequence_length, num_input_channels)`, *requ
HIGHsrc/transformers/models/vivit/modular_vivit.py172 Examples: ```python >>> import av >>> import numpy as np >>> from transformer
HIGHsrc/transformers/models/vivit/modular_vivit.py298 labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the image cl
HIGHsrc/transformers/models/vivit/modeling_vivit.py343 Examples: ```python >>> import av >>> import numpy as np >>> from transformer
HIGHsrc/transformers/models/vivit/modeling_vivit.py469 labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the image cl
HIGH…rmers/models/efficientloftr/modeling_efficientloftr.py896 Copied from kornia library : kornia/geometry/subpix/dsnt.py:76 Compute the expectation of coordinate values usi
HIGHsrc/transformers/models/x_clip/modeling_x_clip.py680 Examples: ```python >>> import av >>> import torch >>> import numpy as np
HIGHsrc/transformers/models/x_clip/modeling_x_clip.py1001 return_loss (`bool`, *optional*): Whether or not to return the contrastive loss. Examples:
HIGHsrc/transformers/models/x_clip/modeling_x_clip.py1156 Examples: ```python >>> import av >>> import torch >>> import numpy as np
HIGHsrc/transformers/models/x_clip/modular_x_clip.py293 Examples: ```python >>> import av >>> import torch >>> import numpy as np
HIGHsrc/transformers/models/x_clip/modular_x_clip.py565 Examples: ```python >>> import av >>> import torch >>> import numpy as np
HIGHsrc/transformers/models/x_clip/modular_x_clip.py661 return_loss (`bool`, *optional*): Whether or not to return the contrastive loss. Examples:
HIGH…ansformers/models/qwen2_5_omni/modular_qwen2_5_omni.py848 Calculate the 3D rope index based on image and video's temporal, height and width in LLM. Explanation:
HIGH…nsformers/models/qwen2_5_omni/modeling_qwen2_5_omni.py232 Calculate the 3D rope index based on image and video's temporal, height and width in LLM. Explanation:
14 more matches not shown…
Redundant / Tautological Comments240 hits · 308 pts
SeverityFileLineSnippet
LOWbenchmark/benchmarks_entrypoint.py445 # Check if the file has a run_benchmark function
LOWbenchmark/benchmarks_entrypoint.py471 # Check if the module has an updated run_benchmark function that accepts metrics_recorder
LOWbenchmark/benches/llama.py76 # Check if required ML dependencies are available
LOWbenchmark_v2/framework/benchmark_runner.py297 # Check if generation had the right number of tokens
LOWtests/test_modeling_common.py1366 # Set seed to ensure stable model initialization - avoids numerical issues (NaN) with some models
LOWtests/test_modeling_common.py4740 # Check if this given pattern matches any param or module (the value attributed to the pattern does not
LOWtests/test_processing_common.py212 # Check if there's a custom setup method for this specific attribute
LOWtests/test_image_processing_common.py584 # Check if torchvision backend is available
LOWtests/test_image_processing_common.py595 # Check if the file exists otherwise skip the test
LOWtests/test_image_processing_common.py611 # Check if committed before the cutoff date
LOWtests/test_image_processing_common.py621 # Check if this is a new model (added after 2024-01-01) based on git history
LOWtests/test_video_processing_common.py346 # Set sampling to True. Video frames should be sampled with `num_frames` in the output
LOWtests/test_tokenizers_backend_mixin.py411 # Check if the special tokens have been kept (all_special_tokens returns strings)
LOWtests/kernels/test_kernels.py123 # Check if both modules have a 'forward' attribute
LOWtests/kernels/test_kernels.py148 # Check if both modules have a 'forward' attribute
LOWtests/utils/test_offline.py219 # Return output
LOWtests/utils/test_cache_utils.py708 # Check if cache config is passed through correctly
LOWtests/utils/test_cache_utils.py718 # Check if the exported model is configured with the `StaticCache` correctly
LOWtests/models/udop/test_tokenization_udop.py1267 # Check if the AddedToken / string format has been kept
LOWtests/models/gpt_oss/test_modeling_gpt_oss.py200 # Check if we have expected results for this configuration
LOWtests/models/gpt_oss/test_modeling_gpt_oss.py401 # Check if we have expected results for this configuration
LOW…itional_detr/test_image_processing_conditional_detr.py326 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOW…itional_detr/test_image_processing_conditional_detr.py449 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOWtests/models/markuplm/test_tokenization_markuplm.py1272 # Check if the AddedToken / string format has been kept
LOW…s/video_llama_3/test_video_processing_video_llama_3.py329 # Set sampling to True. Video frames should be sampled with `num_frames` in the output
LOWtests/models/colqwen2/test_modeling_colqwen2.py331 # Check if the maximum scores per row are in the diagonal of the matrix score
LOWtests/models/colqwen2/test_modeling_colqwen2.py386 # Check if the maximum scores per row are in the diagonal of the matrix score
LOWtests/models/eomt/test_image_processing_eomt.py272 # Set longest_edge to None to test for semantic segmentatiom.
LOWtests/models/rt_detr/test_image_processing_rt_detr.py328 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOW…grounding_dino/test_image_processing_grounding_dino.py320 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOW…grounding_dino/test_image_processing_grounding_dino.py496 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOWtests/models/layoutlmv2/test_tokenization_layoutlmv2.py1311 # Check if the AddedToken / string format has been kept
LOWtests/models/layoutlmv3/test_tokenization_layoutlmv3.py1359 # Check if the AddedToken / string format has been kept
LOWtests/models/colpali/test_modeling_colpali.py273 # Check if the maximum scores per row are in the diagonal of the matrix score
LOW…formable_detr/test_image_processing_deformable_detr.py335 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOW…formable_detr/test_image_processing_deformable_detr.py458 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOWtests/models/paligemma/test_modeling_paligemma.py320 # Check if pad tokens are properly masked
LOWtests/models/moshi/test_tokenization_moshi.py246 # Check if the AddedToken / string format has been kept
LOWtests/models/smolvlm/test_video_processing_smolvlm.py133 # Set sampling to True. Video frames should be sampled with `num_frames` in the output
LOWtests/models/layoutxlm/test_tokenization_layoutxlm.py1470 # Check if the AddedToken / string format has been kept
LOWtests/models/yolos/test_image_processing_yolos.py365 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOWtests/models/yolos/test_image_processing_yolos.py488 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOWtests/models/qwen2_vl/test_video_processing_qwen2_vl.py320 # Set sampling to True. Video frames should be sampled with `num_frames` in the output
LOWtests/models/detr/test_image_processing_detr.py393 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOWtests/models/detr/test_image_processing_detr.py515 # Check if do_convert_annotations=False, then the annotations are not converted to centre_x, centre_y, width
LOW…/models/colmodernvbert/test_modeling_colmodernvbert.py247 # Check if the maximum scores per row are in the diagonal of the matrix score
LOWtests/models/whisper/test_modeling_whisper.py501 # Check if beam_indices and sequences_scores are in the output
LOWtests/models/whisper/test_modeling_whisper.py2110 # Set model to training mode to enable SpecAugment
LOWtests/repo_utils/test_check_copies.py449 # Check if the model link is synchronized.
LOWtests/trainer/trainer_test_utils.py582 if log[key] != log[key]: # Check if the value is NaN
LOWtests/trainer/test_trainer_checkpointing.py270 # Check if it works for a simple language modeling example
LOWtests/trainer/test_trainer_checkpointing.py954 # Check if the model weights file exists in the final checkpoint directory.
LOWtests/trainer/test_trainer.py434 # Check if model weights have been updated
LOWtests/generation/test_utils.py2943 "# Calculate the sum\nresult = num1 + num2\n\n# Print the result\nprint(result)\n```\n"
LOWutils/check_docstrings.py841 # Check if docstring starts and ends on the same line
LOWutils/check_docstrings.py855 # Check if it's named "auto_docstring"
LOWutils/check_docstrings.py1214 # Check if this arg has placeholders
LOWutils/check_docstrings.py1471 # Check if this method is inside a processor class
LOWutils/check_docstrings.py1476 # Check if class inherits from ModelOutput, ProcessorMixin, or PreTrainedConfig
LOWutils/check_docstrings.py1784 # Check if any fields are missing or need removal
180 more matches not shown…
Excessive Try-Catch Wrapping289 hits · 289 pts
SeverityFileLineSnippet
LOWbenchmark/benchmarks_entrypoint.py374 except Exception as e:
LOWbenchmark/benchmarks_entrypoint.py392 except Exception as e:
LOWbenchmark/benchmarks_entrypoint.py454 except Exception as e:
LOWbenchmark/benchmarks_entrypoint.py486 except Exception as e:
LOWbenchmark/benchmarks_entrypoint.py499 except Exception as e:
MEDIUMbenchmark/benchmarks_entrypoint.py367def import_from_path(module_name, file_path):
LOWbenchmark/benches/llama.py94 except Exception as e:
LOWbenchmark/benches/llama.py345 except Exception as e:
LOW…rk_v2/benchmark_scripts/continuous_batching_overall.py235 except Exception as e:
LOWbenchmark_v2/framework/hardware_metrics.py46 except Exception:
LOWbenchmark_v2/framework/hardware_metrics.py202 except Exception:
LOWbenchmark_v2/framework/hardware_metrics.py221 except Exception as e:
LOWbenchmark_v2/framework/hardware_metrics.py231 except Exception as e:
LOWbenchmark_v2/framework/hardware_metrics.py236 except Exception as e:
LOWbenchmark_v2/framework/hardware_metrics.py242 except Exception as e:
LOWbenchmark_v2/framework/hardware_metrics.py289 except Exception:
LOWbenchmark_v2/framework/benchmark_runner.py365 except Exception as e:
LOWbenchmark_v2/framework/benchmark_config.py45 except Exception as _:
LOWtests/test_tokenization_common.py294 except Exception:
LOWtests/test_tokenization_common.py2786 except Exception as e:
LOWtests/test_tokenization_common.py2893 except Exception as e:
LOWtests/test_modeling_common.py2307 except Exception as e:
LOWtests/test_modeling_common.py2421 except Exception as e:
LOWtests/test_modeling_common.py280 except Exception as _:
LOWtests/test_modeling_common.py2530 except Exception as e:
LOWtests/test_modeling_common.py4240 except Exception as e:
LOWtests/test_modeling_common.py4296 except Exception as e:
LOWtests/test_modeling_common.py5719 except Exception as e:
LOWtests/test_processing_common.py226 except Exception as e:
LOWtests/test_processing_common.py592 except Exception:
LOWtests/test_processing_common.py623 except Exception:
LOWtests/test_processing_common.py663 except Exception:
LOWtests/test_processing_common.py695 except Exception:
MEDIUMtests/test_image_processing_common.py590def _is_old_model_by_commit_date(model_type, date_cutoff=(2025, 9, 1)):
LOWtests/test_image_processing_common.py615 except Exception:
LOWtests/test_pipeline_mixin.py376 except Exception:
LOWtests/test_pipeline_mixin.py403 except Exception:
LOWtests/test_sentencepiece_backend_mixin.py139 except Exception:
LOWtests/test_tokenizers_backend_mixin.py63 except Exception as e:
LOWtests/test_tokenizers_backend_mixin.py485 except Exception as e:
LOWtests/kernels/test_kernels.py396 except Exception as e:
LOWtests/kernels/test_kernels.py400 except Exception as e:
LOWtests/kernels/test_kernels.py77 except Exception as e:
LOWtests/kernels/test_kernels.py87 except Exception as e:
LOWtests/kernels/test_kernels.py415 except Exception as e:
LOWtests/kernels/test_kernels.py419 except Exception as e:
LOWtests/kernels/test_kernels.py436 except Exception as e:
LOW…pelines/test_pipelines_automatic_speech_recognition.py1817 except Exception:
LOWtests/utils/test_auto_docstring.py726 except Exception:
LOW…v2_tokenizer/test_modeling_higgs_audio_v2_tokenizer.py228 except Exception:
LOW…v2_tokenizer/test_modeling_higgs_audio_v2_tokenizer.py233 except Exception:
LOWtests/models/marian/test_modeling_marian.py351 except Exception:
LOWtests/models/mvp/test_modeling_mvp.py490 except Exception:
LOWtests/models/led/test_modeling_led.py471 except Exception:
LOWtests/models/pegasus_x/test_modeling_pegasus_x.py546 except Exception:
LOWtests/models/rag/test_modeling_rag.py76 except Exception:
LOWtests/models/wav2vec2/test_modeling_wav2vec2.py126 except Exception:
LOWtests/models/pegasus/test_modeling_pegasus.py296 except Exception:
LOWtests/models/bart/test_modeling_bart.py513 except Exception:
LOWtests/models/plbart/test_modeling_plbart.py312 except Exception:
229 more matches not shown…
Hallucination Indicators21 hits · 220 pts
SeverityFileLineSnippet
CRITICALbenchmark_v2/framework/benchmark_runner.py101 torch._inductor.codecache.TritonFuture._compile_cache.clear()
CRITICALtests/models/fsmt/test_modeling_fsmt.py260 model.base_model.decoder.output_projection.weight.data_ptr(),
CRITICALtests/models/fsmt/test_modeling_fsmt.py276 model.base_model.decoder.output_projection.weight.data_ptr(),
CRITICALtests/models/mbart/test_modeling_mbart.py344 model.base_model.decoder.embed_tokens.weight.data_ptr(),
CRITICALtests/models/mbart/test_modeling_mbart.py345 model.base_model.encoder.embed_tokens.weight.data_ptr(),
CRITICALtests/models/mbart/test_modeling_mbart.py327 model.base_model.decoder.embed_tokens.weight.data_ptr(),
CRITICALtests/models/mbart/test_modeling_mbart.py328 model.base_model.encoder.embed_tokens.weight.data_ptr(),
CRITICALtests/generation/test_continuous_batching.py97 torch._inductor.codecache.TritonFuture._compile_cache.clear()
CRITICALutils/check_repo.py1362 model_types = list(transformers.models.auto.configuration_auto.CONFIG_MAPPING_NAMES.keys())
CRITICALsrc/transformers/trainer.py2198 kwargs.update({"dtype": self.accelerator.state.deepspeed_plugin.hf_ds_config.dtype()})
CRITICALsrc/transformers/tokenization_mistral_common.py593 return self.tokenizer.instruct_tokenizer.tokenizer._model.piece_to_id(piece)
CRITICAL…ransformers/models/marian/convert_marian_to_pytorch.py626 model.lm_head.weight.data = model.model.decoder.embed_tokens.weight.data.clone()
CRITICAL…s/models/conditional_detr/modeling_conditional_detr.py1784 object_queries_position_embeddings = self.conditional_detr.model.query_position_embeddings.weight.unsqueeze(
CRITICAL…_vl_hybrid/convert_deepseek_vl_hybrid_weights_to_hf.py74 r"vision_model.vision_tower_low.vision_tower.attn_pool.mlp.fc(\d+).(weight|bias)": r"model.vision_model.visio
CRITICAL…ers/models/clip/convert_clip_original_pytorch_to_hf.py92 hf_model.visual_projection.weight.data = pt_model.visual.proj.data.T.contiguous()
CRITICALsrc/transformers/models/rwkv/modeling_rwkv.py630 block.attention.output.weight.SCB.div_(2 ** int(block_id // self.config.rescale_every))
CRITICALsrc/transformers/models/rwkv/modeling_rwkv.py631 block.feed_forward.value.weight.SCB.div_(2 ** int(block_id // self.config.rescale_every))
CRITICAL…rmers/models/seamless_m4t_v2/convert_fairseq2_to_hf.py284 original_model.model.t2u_model.decoder_frontend.char_tokenizer.model.index_to_token(i): i for i in range(10904)
CRITICALsrc/transformers/models/detr/modeling_detr.py1575 object_queries_position_embeddings = self.detr.model.query_position_embeddings.weight.unsqueeze(0).repeat(
CRITICALsrc/transformers/integrations/mxfp4.py233 module.gate_up_proj_precision_config.weight_scale.storage.layout.unswizzle_data(
CRITICALsrc/transformers/integrations/mxfp4.py244 module.down_proj_precision_config.weight_scale.storage.layout.unswizzle_data(
AI Slop Vocabulary96 hits · 163 pts
SeverityFileLineSnippet
MEDIUMpyproject.toml106# Using default settings for comprehensive type checking
MEDIUMbenchmark/benchmarks_entrypoint.py250 # Create comprehensive summary using pandas operations
MEDIUMbenchmark/benchmarks_entrypoint.py301 # Export the comprehensive summary
MEDIUMtests/test_tokenization_common.py323 # Default comprehensive test string covering various edge cases
MEDIUMtests/test_modeling_common.py710 # Note: for all mixins that utilize the Hub in some way, we should ensure that
LOWtests/tensor_parallel/test_tensor_parallel.py324 # so just use a SimpleNamespace to test that the attribute is updated correctly.
LOWtests/pipelines/test_pipelines_common.py211 # If dtype is NOT specified in the pipeline constructor, the property should just return
LOWtests/pipelines/test_pipelines_common.py216 # If underlying model doesn't have dtype property, simply return None
LOWtests/utils/test_modeling_utils.py2863 # a KeyError; they should simply return False.
MEDIUMtests/utils/test_auto_docstring.py688 # Relative metric; robust across CI vs local. Catches serious regressions.
MEDIUM…odels/bigbird_pegasus/test_modeling_bigbird_pegasus.py537 ARTICLE_LEP = r"""the lep experiments at the resonance of @xmath1-boson have tested the standard model ( sm ) at
MEDIUM…odels/bigbird_pegasus/test_modeling_bigbird_pegasus.py537 ARTICLE_LEP = r"""the lep experiments at the resonance of @xmath1-boson have tested the standard model ( sm ) at
MEDIUM…odels/bigbird_pegasus/test_modeling_bigbird_pegasus.py539 ARTICLE_MAGNET = r"""it is well known that the classical magnetoresistance ( mr ) in metals or semiconductors wi
LOWtests/models/clvp/test_modeling_clvp.py450 # the testing for text encoder stays standard because we just pass the text tokens here.
LOWtests/models/modernvbert/test_modeling_modernvbert.py145 # For simplicity just set the last n tokens to the image token
MEDIUMtests/models/led/test_modeling_led.py544 ARTICLE_LEP = r"""the lep experiments at the resonance of @xmath1-boson have tested the standard model ( sm ) at
MEDIUMtests/models/led/test_modeling_led.py544 ARTICLE_LEP = r"""the lep experiments at the resonance of @xmath1-boson have tested the standard model ( sm ) at
MEDIUMtests/models/led/test_modeling_led.py546 ARTICLE_MAGNET = r"""it is well known that the classical magnetoresistance ( mr ) in metals or semiconductors wi
MEDIUM…els/gemma4_assistant/test_modeling_gemma4_assistant.py109 ("cuda", (8, 6)): ['## The Algorithmic Mind\n\nA tapestry of data, vast and deep,\nWhere silent numbers
MEDIUMtests/models/gemma4/test_modeling_gemma4.py766 ("cuda", (8, 6)): ['## The Algorithmic Mind\n\nA tapestry of data, vast and deep,\nWhere silent numbers
MEDIUMtests/models/gemma4/test_modeling_gemma4.py791 ("cuda", (8, 6)): ['## The Algorithmic Mind\n\nA tapestry of data, vast and deep,\nWhere silent numbers
LOWtests/models/bloom/test_modeling_bloom.py224 # TODO change the script (or just add skip) when building the env with tokenizers 0.12.0
LOWtests/models/lfm2_vl/test_modeling_lfm2_vl.py138 # For simplicity just set the last n tokens to the image token
MEDIUMtests/models/paligemma/test_modeling_paligemma.py576 # this is a supplementary test to ensure paligemma fine-tuning that relies on token_type_ids is robust to future
LOWtests/models/idefics3/test_modeling_idefics3.py150 # For simplicity just set the last n tokens to the image token
LOWtests/models/smolvlm/test_modeling_smolvlm.py152 # For simplicity just set the last n tokens to the image token
LOWtests/models/idefics2/test_modeling_idefics2.py160 # For simplicity just set the last n tokens to the image token
LOW…/models/colmodernvbert/test_modeling_colmodernvbert.py140 # For simplicity just set the first n tokens to the image token
MEDIUMtests/models/whisper/test_processing_whisper.py171 """Test using the old processing functions used in the ASR pipeline, but that serves as a BC reference."""
LOWtests/generation/test_utils.py2568 # In this case, we simply call recursively the function on both internal caches
LOWtests/generation/test_utils.py2658 # In this case, we simply call recursively the function on both internal caches
MEDIUMtests/generation/test_logits_process.py758 # scores = 0 to facilitate checks
LOWutils/check_docstrings.py547 # Default None are not written, we just set `*optional*`. If there is default that is not None specified in the
MEDIUMutils/get_test_reports.py137 """Command-line interface for running test suite with comprehensive reporting. Check handle_suite for more details.
MEDIUMutils/create_dummy_models.py369 # New method that is more robust to get checkpoints!
LOWutils/notification_service.py169 # `dicts_to_sum` uses `dicts_to_sum` which requires a non empty dictionary. Let's just add an empty entry.
LOWutils/check_inits.py119 # If this is a traditional init, just return.
MEDIUMsrc/transformers/tokenization_utils_base.py3213 # To make this more robust, we could do a diff and find the longest common subsequence, but this is
MEDIUMsrc/transformers/testing_utils.py3471 # TODO: check simply with the name is not robust.
LOWsrc/transformers/testing_utils.py3716 # If the target callable is not called within a test, simply call it without modification.
LOWsrc/transformers/testing_utils.py3793 # We simply add "self" as the expression despite it might not be the actual argument name.
LOWsrc/transformers/modeling_utils.py5026 # fragmentation issues) simply use the pool of 4 GiB unused memory that is available. In those cases, it's b
MEDIUMsrc/transformers/modeling_utils.py4825 """Adds the `_is_hf_initialized` flag on parameters that will be tied, in order to avoid initializing them
LOWsrc/transformers/trainer.py1749 # if loss is nan or inf simply add the average of previous logged losses
LOWsrc/transformers/masking_utils.py839 # If the mask is already 4D, simply return as-is (it was already prepared, or it is custom)
LOWsrc/transformers/trainer_pt_utils.py385 # Check if we have something to add, if not just return
MEDIUMsrc/transformers/pipelines/text_to_audio.py206 # ensure dict output to facilitate postprocessing
MEDIUM…transformers/pipelines/automatic_speech_recognition.py667 # Simply cast from pyctcdecode format to wav2vec2 format to leverage
MEDIUMsrc/transformers/pipelines/mask_generation.py218 # Consider using a more robust method for distinguishing model types here.
LOWsrc/transformers/utils/chat_parsing_utils.py83 # If the schema has a const, we just return that value and do absolutely nothing else
LOWsrc/transformers/utils/output_capturing.py108 # If it's None or not a key we want to capture, simply return, the hook is inactive
MEDIUM…/transformers/models/metaclip_2/modeling_metaclip_2.py506 # Use robust pooling like CLIP - finds the first EOS token position per sequence
MEDIUM…c/transformers/models/metaclip_2/modular_metaclip_2.py277 # Use robust pooling like CLIP - finds the first EOS token position per sequence
LOW…formers/models/edgetam_video/modeling_edgetam_video.py169 # As the feature map size is fixed, we can just return the pre-computed embeddings.
LOWsrc/transformers/models/clvp/modeling_clvp.py495 # We can probably just use the multi-head attention module of PyTorch >=1.1.0
LOWsrc/transformers/models/vilt/image_processing_vilt.py226 # If no padding, just return the processed images
LOWsrc/transformers/models/electra/modeling_electra.py727 # We can probably just use the multi-head attention module of PyTorch >=1.1.0
LOWsrc/transformers/models/led/modeling_led.py371 # the case hidden_states.size(1) == window_overlap * 2 can also simply return hidden_states.unsqueeze(1), but th
LOWsrc/transformers/models/led/modeling_led.py1320 # simply use `global_attention_mask` as `attention_mask`
MEDIUMsrc/transformers/models/auto/tokenization_auto.py671 # First, let's see whether the tokenizer_type is passed so that we can leverage it
36 more matches not shown…
Verbosity Indicators88 hits · 125 pts
SeverityFileLineSnippet
LOWtests/utils/test_cache_utils.py1214 # Step 0 : multi-token prefill
LOWtests/utils/test_cache_utils.py1226 # Step 1 : multi-token update crossing the window boundary
LOWtests/quantization/bnb/test_mixed_int8.py904 # Step 1: freeze all parameters
LOWtests/quantization/bnb/test_mixed_int8.py925 # Step 2: add adapters
LOWtests/quantization/bnb/test_mixed_int8.py932 # Step 3: dummy batch
LOWtests/quantization/bnb/test_mixed_int8.py935 # Step 4: Check if the gradient is not None
LOWtests/quantization/bnb/test_4bit.py631 # Step 1: freeze all parameters
LOWtests/quantization/bnb/test_4bit.py651 # Step 2: add adapters
LOWtests/quantization/bnb/test_4bit.py658 # Step 3: dummy batch
LOWtests/quantization/bnb/test_4bit.py661 # Step 4: Check if the gradient is not None
LOW…iner/distributed/test_trainer_distributed_deepspeed.py1139 # Step 1: Run with SP enabled
LOW…iner/distributed/test_trainer_distributed_deepspeed.py1160 # Step 2: Run without SP
LOW…s/trainer/distributed/test_trainer_distributed_fsdp.py593 # Step 1: Run with CP enabled (cp_size=2)
LOW…s/trainer/distributed/test_trainer_distributed_fsdp.py605 # Step 2: Run without CP (FSDP with num_processes=1, no parallelism_config)
LOWtests/generation/test_paged_attention.py23 "orange.\n\n## Step 1: Identify the key characteristics of the fruit\nThe fruit is described as being orange
LOWtests/generation/test_paged_attention.py31 "orange.\n\n## Step 1: Identify the key characteristics of the fruit\nThe fruit is described as being orange
LOW.github/workflows/circleci-failure-summary-comment.yml76 # Step 1: Get CircleCI check suite ID
LOW.github/workflows/circleci-failure-summary-comment.yml84 # Step 2: Get check runs from the CircleCI suite
LOW.github/workflows/circleci-failure-summary-comment.yml89 # Step 3: Extract workflow ID from the "run_tests" check run
LOW.github/workflows/circleci-failure-summary-comment.yml93 # Step 4: Get all jobs in the workflow
LOW.github/workflows/circleci-failure-summary-comment.yml98 # Step 5: Extract collection_job details
LOW.github/workflows/circleci-failure-summary-comment.yml115 # Step 6: Get artifacts list
LOW.github/workflows/circleci-failure-summary-comment.yml123 # Step 7: Download failure_summary.json specifically
LOWsrc/transformers/feature_extraction_utils.py518 # not all of these are nested. We need to check if it was saved recebtly as nested or if it is legacy style
LOWsrc/transformers/image_processing_base.py323 # not all of these are nested. We need to check if it was saved recebtly as nested or if it is legacy style
LOWsrc/transformers/video_processing_utils.py665 # not all of these are nested. We need to check if it was saved recebtly as nested or if it is legacy style
LOW…ls/ernie4_5_vl_moe/video_processing_ernie4_5_vl_moe.py220 # not all of these are nested. We need to check if it was saved recebtly as nested or if it is legacy style
LOWsrc/transformers/models/nllb_moe/modeling_nllb_moe.py192 `bitsandbytes` `Linear8bitLt` layers does not support manual casting Therefore we need to check if they are an
LOW…formers/models/edgetam_video/modeling_edgetam_video.py2851 # Step 1: Handle initial conditioning frames
LOW…formers/models/edgetam_video/modeling_edgetam_video.py2863 # Step 2: Get memory frames and concatenate their features
LOW…formers/models/edgetam_video/modeling_edgetam_video.py2873 # Step 3: Get and process object pointers
LOW…formers/models/edgetam_video/modeling_edgetam_video.py2889 # Step 4: Concatenate all retrieved memories and their positional embeddings
LOW…formers/models/edgetam_video/modeling_edgetam_video.py2893 # Step 5: Forward through the memory attention mechanism
LOW…sformers/models/edgetam_video/modular_edgetam_video.py1080 # Step 1: Handle initial conditioning frames
LOW…sformers/models/edgetam_video/modular_edgetam_video.py1092 # Step 2: Get memory frames and concatenate their features
LOW…sformers/models/edgetam_video/modular_edgetam_video.py1102 # Step 3: Get and process object pointers
LOW…sformers/models/edgetam_video/modular_edgetam_video.py1118 # Step 4: Concatenate all retrieved memories and their positional embeddings
LOW…sformers/models/edgetam_video/modular_edgetam_video.py1122 # Step 5: Forward through the memory attention mechanism
LOW…/transformers/models/nemotron_h/modeling_nemotron_h.py506 # Step 2: Compute M, equivalent to applying attention mask to weights
LOW…/transformers/models/nemotron_h/modeling_nemotron_h.py510 # Step 3: Compute Y_diag (apply to values)
LOW…nsformers/models/gemma4/image_processing_pil_gemma4.py231 # Step 1: Aspect-ratio-preserving resize
LOW…nsformers/models/gemma4/image_processing_pil_gemma4.py241 # Step 2: Rescale pixel values from [0, 255] to [0, 1]
LOW…nsformers/models/gemma4/image_processing_pil_gemma4.py245 # Step 3: Identity normalization because Gemma4 was trained with pixels in [0, 1]
LOW…nsformers/models/gemma4/image_processing_pil_gemma4.py249 # Step 4: Patchify the image
LOW…nsformers/models/gemma4/image_processing_pil_gemma4.py255 # Step 5: Compute position IDs
LOW…/transformers/models/gemma4/image_processing_gemma4.py173 # Step 1: Aspect-ratio-preserving resize
LOW…/transformers/models/gemma4/image_processing_gemma4.py183 # Step 2: Rescale pixel values (typically to [0, 1]) and optionally identity normalize
LOW…/transformers/models/gemma4/image_processing_gemma4.py186 # Step 3: Patchify the image
LOW…/transformers/models/gemma4/image_processing_gemma4.py193 # Step 5: Compute position IDs
LOWsrc/transformers/models/auto/image_processing_auto.py298 # not all of these are nested. We need to check if it was saved recently as nested or if it is legacy style
LOWsrc/transformers/models/auto/video_processing_auto.py213 # not all of these are nested. We need to check if it was saved recebtly as nested or if it is legacy style
LOWsrc/transformers/models/auto/feature_extraction_auto.py221 # not all of these are nested. We need to check if it was saved recently as nested or if it is legacy style
LOWsrc/transformers/models/zamba2/modeling_zamba2.py794 # Step 2: Compute M, equivalent to applying attention mask to weights
LOWsrc/transformers/models/zamba2/modeling_zamba2.py798 # Step 3: Compute Y_diag (apply to values)
LOWsrc/transformers/models/zamba2/modular_zamba2.py582 # Step 2: Compute M, equivalent to applying attention mask to weights
LOWsrc/transformers/models/zamba2/modular_zamba2.py586 # Step 3: Compute Y_diag (apply to values)
LOW…/transformers/models/sam3_video/modeling_sam3_video.py291 # Step 1: Update the object id mapping (note that it must be done after Step 0,
LOW…/transformers/models/sam3_video/modeling_sam3_video.py305 # Step 2: For per-object tensor storage, we shift their obj_idx in the dict keys.
LOW…/transformers/models/sam3_video/modeling_sam3_video.py1483 # Step 1: add new objects from FA detection to SAM2 inference states
LOW…/transformers/models/sam3_video/modeling_sam3_video.py1496 # Step 2: remove from SAM2 inference states those objects removed by heuristics
28 more matches not shown…
Cross-Language Confusion22 hits · 122 pts
SeverityFileLineSnippet
HIGHtests/utils/test_model_output.py155 '[1, {"type": "tests.utils.test_model_output.ModelOutputTest", "context": "[\\"a\\", \\"c\\"]", "children_sp
HIGHtests/utils/test_chat_parsing_utils.py507 'null_value:null,number_value:1,string_value:<|"|>foo<|"|>,'
HIGHutils/check_import_complexity.py67 self._tracer.push(self._fullname)
HIGH.circleci/create_circleci_config.py73 {"run": "pip install requests || true"},
HIGH.circleci/create_circleci_config.py75 "run": """while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE
HIGH.circleci/create_circleci_config.py78 "run": "python utils/process_circleci_workflow_test_reports.py --workflow_id $CIRCLE_WORKFLOW_ID
HIGH.circleci/create_circleci_config.py182 {"run": "apt-get update && apt-get install -y curl"},
HIGH.circleci/create_circleci_config.py195 "command": """du -h -d 1 "$(pip -V | cut -d ' ' -f 4 | sed 's/pip//g')" | grep -vE "dist-info|_distu
HIGH.circleci/create_circleci_config.py201 "command": """pip list --format=freeze | tee installed.txt || true""",
HIGH.circleci/create_circleci_config.py222 "command": f"TESTS=$(circleci tests split --split-by=timings {self.job_name}_test_list.txt) && echo
HIGH.circleci/create_circleci_config.py232 "command": "cp -r /test_data/* . 2>/dev/null || true; python3 utils/fetch_hub_objects_for_ci.py",
HIGH.circleci/create_circleci_config.py238 "command": 'curl -L -o huggingface-cache.tar.gz https://huggingface.co/datasets/hf-internal-testing/
HIGHsrc/transformers/quantizers/quantizer_fp_quant.py54 "Using `fp_quant` with real quantization requires a **Blackwell GPU** and qutlass: `git clone https://gi
HIGHsrc/transformers/models/auto/auto_factory.py246 # Check both `quantization_config` being present and also not null,
HIGHsrc/transformers/models/auto/auto_factory.py400 # Check both `quantization_config` being present and also not null,
HIGHsrc/transformers/models/xlm/tokenization_xlm.py305 logger.error("1. git clone git@github.com:neubig/kytea.git && cd kytea")
HIGHsrc/transformers/models/xlm/tokenization_xlm.py308 logger.error("4. make && make install")
HIGHsrc/transformers/models/xlm/tokenization_xlm.py381 git clone git@github.com:neubig/kytea.git && cd kytea autoreconf -i ./configure --prefix=$HOME/local
HIGHsrc/transformers/models/xlm/tokenization_xlm.py382 make && make install pip install kytea
HIGH…/transformers/models/flaubert/tokenization_flaubert.py304 logger.error("1. git clone git@github.com:neubig/kytea.git && cd kytea")
HIGH…/transformers/models/flaubert/tokenization_flaubert.py307 logger.error("4. make && make install")
HIGHsrc/transformers/integrations/executorch.py219 # If `layer_types` is not specified explicitly in the config or `sliding_window` is null,
Slop Phrases64 hits · 61 pts
SeverityFileLineSnippet
LOWtests/test_modeling_common.py4715 # If none of the config and subconfigs have a tp_plan, then skip (otherwise we should make sure to respect the p
LOWtests/models/whisper/test_modeling_whisper.py109 # make sure to use correct index if a batch was removed
LOWutils/check_docstrings.py387# below, make sure to add a comment explaining why.
LOWsrc/transformers/core_model_loading.py247 # We squeeze each chunk here as well to make sure to give them their original shape
LOWsrc/transformers/core_model_loading.py1416 # so we need to make sure to load the tensor with the same dtype from the checkpoint
LOWsrc/transformers/trainer.py1867 # After training we make sure to retrieve back the original forward pass method
LOW…ers/models/ernie4_5_vl_moe/modeling_ernie4_5_vl_moe.py1663 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…mers/models/ernie4_5_vl_moe/modular_ernie4_5_vl_moe.py1205 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/laguna/modeling_laguna.py746 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/gpt_oss/modeling_gpt_oss.py682 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/olmoe/modeling_olmoe.py695 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/clvp/configuration_clvp.py81 # make sure to have the config_type be either "text_config" or "speech_config"
LOW…/transformers/models/qwen3_next/modeling_qwen3_next.py1178 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/mellum/modeling_mellum.py723 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/mixtral/modeling_mixtral.py670 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/mixtral/modular_mixtral.py416 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…/transformers/models/minimax_m2/modeling_minimax_m2.py678 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…mers/models/colqwen2/convert_colqwen2_weights_to_hf.py17Don't forget to manually upload the processor-related files to the HF model repository
LOW…mers/models/colqwen2/convert_colqwen2_weights_to_hf.py180 Don't forget to manually upload the processor-related files to the HF model repository
LOWsrc/transformers/models/jetmoe/modeling_jetmoe.py814 loss += self.aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/jetmoe/modular_jetmoe.py581 loss += self.aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…/transformers/models/granitemoe/modeling_granitemoe.py719 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…c/transformers/models/granitemoe/modular_granitemoe.py304 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…pas/convert_tapas_original_tf_checkpoint_to_pytorch.py174 # If you want to convert a checkpoint that uses absolute position embeddings, make sure to set reset_position_index_
LOW…ata2vec_text_original_pytorch_checkpoint_to_pytorch.py39# IMPORTANT: In order for this script to run, please make sure to download the dictionary: `dict.txt` from wget https://
LOWsrc/transformers/models/flex_olmo/modeling_flex_olmo.py688 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…/transformers/models/layoutlmv2/modeling_layoutlmv2.py1078 >>> boxes = data["bboxes"] # make sure to normalize your bounding boxes
LOW…s/models/granitemoehybrid/modeling_granitemoehybrid.py1400 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/minimax/modeling_minimax.py879 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/jamba/modeling_jamba.py933 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/phimoe/modeling_phimoe.py862 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/voxtral/processing_voxtral.py313 # make sure to remove from text_kwargs and audio_kwargs
LOWsrc/transformers/models/siglip/modeling_siglip.py511 >>> # important: make sure to set padding="max_length" as that's how the model was trained
LOWsrc/transformers/models/siglip/modeling_siglip.py695 >>> # important: make sure to set padding="max_length" as that's how the model was trained
LOWsrc/transformers/models/doge/modular_doge.py636 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/doge/modeling_doge.py805 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…ransformers/models/qwen3_5_moe/modeling_qwen3_5_moe.py1892 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…ransformers/models/qwen3_5_moe/modeling_qwen3_5_moe.py2050 ) # make sure to reside in the same device
LOWsrc/transformers/models/dbrx/modular_dbrx.py536 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/dbrx/modeling_dbrx.py748 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…ransformers/models/deepseek_v4/modeling_deepseek_v4.py1488 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…nsformers/models/ernie4_5_moe/modeling_ernie4_5_moe.py729 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/siglip2/modeling_siglip2.py627 >>> # important: make sure to set padding="max_length" as that's how the model was trained
LOWsrc/transformers/models/siglip2/modeling_siglip2.py760 >>> # important: make sure to set padding="max_length" as that's how the model was trained
LOWsrc/transformers/models/glm4v_moe/modular_glm4v_moe.py399 ) # make sure to reside in the same device
LOWsrc/transformers/models/glm4v_moe/modeling_glm4v_moe.py1654 ) # make sure to reside in the same device
LOW…ansformers/models/qwen3_vl_moe/modular_qwen3_vl_moe.py444 ) # make sure to reside in the same device
LOW…nsformers/models/qwen3_vl_moe/modeling_qwen3_vl_moe.py1617 ) # make sure to reside in the same device
LOW…s/models/granitemoeshared/modeling_granitemoeshared.py788 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…ormers/models/qwen3_omni_moe/modular_qwen3_omni_moe.py1392 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…ormers/models/qwen3_omni_moe/modular_qwen3_omni_moe.py1825 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…rmers/models/qwen3_omni_moe/modeling_qwen3_omni_moe.py2238 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…rmers/models/qwen3_omni_moe/modeling_qwen3_omni_moe.py3149 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOW…convert_fsmt_original_pytorch_checkpoint_to_pytorch.py15# Note: if you intend to run this script make sure you look under scripts/fsmt/
LOWsrc/transformers/models/fsmt/modeling_fsmt.py106(don't forget to install sacrebleu: `pip install sacrebleu`)
LOWsrc/transformers/models/qwen2_moe/modeling_qwen2_moe.py707 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/whisper/generation_whisper.py906 # output tokens from the list of dicts. If we use batch size > 1, we make sure to pad the output
LOWsrc/transformers/models/whisper/generation_whisper.py588 >>> # make sure to NOT truncate the input audio, to return the `attention_mask` and to pad to the longest audio
LOWsrc/transformers/models/qwen3_moe/modeling_qwen3_moe.py699 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
LOWsrc/transformers/models/qwen3_moe/modular_qwen3_moe.py173 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
4 more matches not shown…
Fake / Example Data13 hits · 17 pts
SeverityFileLineSnippet
LOWtests/pipelines/test_pipelines_fill_mask.py169 dummy_str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit," * 100
LOWtests/pipelines/test_pipelines_fill_mask.py169 dummy_str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit," * 100
LOWtests/models/solar_open/test_modeling_solar_open.py101 "Lorem ipsum dolor sit amet",
LOWtests/models/solar_open/test_modeling_solar_open.py101 "Lorem ipsum dolor sit amet",
LOWtests/models/solar_open/test_modeling_solar_open.py108 "Lorem ipsum dolor sit amet=√=√=√ 치수 치수 치수 치수 치수 치수 치수 Shelley Shelley Shelley Shelley Shelley Shell
LOWtests/models/solar_open/test_modeling_solar_open.py108 "Lorem ipsum dolor sit amet=√=√=√ 치수 치수 치수 치수 치수 치수 치수 Shelley Shelley Shelley Shelley Shelley Shell
LOWtests/models/solar_open/test_modeling_solar_open.py112 "Lorem ipsum dolor sit amet=√=√ 치수=√ 치수 치수 치수 치수 치수 Shelley Shelley Shelley Shelley Shelley Shelley
LOWtests/models/solar_open/test_modeling_solar_open.py112 "Lorem ipsum dolor sit amet=√=√ 치수=√ 치수 치수 치수 치수 치수 Shelley Shelley Shelley Shelley Shelley Shelley
LOWtests/models/donut/test_processing_donut.py29 "name": "John Doe",
LOW…ts/models/markuplm/test_feature_extraction_markuplm.py94 expected_nodes = [['sample document', 'Goog', 'This is one header', 'This is a another Header', 'Travel from', '
LOWtests/models/lfm2_moe/test_modeling_lfm2_moe.py195 prompts = ["Who are you?", "Complete the text: Lorem ipsum dolor ", "The Meji Restoration in Japan ended"]
LOWtests/models/lfm2_moe/test_modeling_lfm2_moe.py201 "Complete the text: Lorem ipsum dolor ipsum dolor ipsum dolor ipsum dolor ipsum.",
LOWtests/models/lfm2_moe/test_modeling_lfm2_moe.py206 "Complete the text: Lorem ipsum dolor ipsum dolor ipsum dolor ipsum dolor ipsum dolor",
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippet
HIGHdocs/source/en/model_output_tracing.md48 # Captures second output as requested (index=1)
Overly Generic Function Names9 hits · 7 pts
SeverityFileLineSnippet
LOWtests/utils/test_auto_docstring.py218 f.write("def helper(): pass")
LOWtests/cli/test_serve.py1877 async def handle_request(_body, _request_id):
LOWsrc/transformers/utils/deprecation.py85 def my_function(do_reduce_labels):
LOWsrc/transformers/utils/deprecation.py95 def my_function(max_size):
LOWsrc/transformers/utils/generic.py732 def my_function(arg1, arg2, **kwargs):
LOWsrc/transformers/cli/serving/transcription.py85 async def handle_request(self, request: Request) -> JSONResponse | StreamingResponse:
LOWsrc/transformers/cli/serving/chat_completion.py123 async def handle_request(self, body: dict, request_id: str) -> StreamingResponse | JSONResponse:
LOWsrc/transformers/cli/serving/completion.py77 async def handle_request(self, body: dict, request_id: str) -> "StreamingResponse | JSONResponse":
LOWsrc/transformers/cli/serving/response.py367 async def handle_request(self, body: dict, request_id: str) -> StreamingResponse | JSONResponse:
Example Usage Blocks4 hits · 6 pts
SeverityFileLineSnippet
LOWtests/generation/test_flash_attention_parity.py15# Usage:
LOWutils/compare_test_runs.py79# Example usage:
LOW…mples/quantization/custom_quantization_int8_example.py227# Example usage
LOWexamples/pytorch/continuous_batching.py315# Example usage:
Dead Code2 hits · 4 pts
SeverityFileLineSnippet
MEDIUMsrc/transformers/models/glpn/modeling_glpn.py483
MEDIUMsrc/transformers/models/glpn/modeling_glpn.py484