🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.
This report presents the forensic synthetic code analysis of huggingface/peft, a Python project with 21,393 GitHub stars. SynthScan v2.0 examined 195,534 lines of code across 845 source files, recording 3009 pattern matches distributed across 20 syntactic categories. The overall adjusted score of 18.2 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 3009 distinct pattern matches across 20 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_mixed.py | 449 | def test_target_different_layers(self, config0, config1): | CODE |
| LOW | tests/test_mixed.py | 490 | def test_target_last_layer_same_type(self, config0, config1): | CODE |
| LOW | tests/test_mixed.py | 519 | def test_target_first_layer_same_type(self, config0, config1): | CODE |
| LOW | tests/test_mixed.py | 667 | def test_get_nb_trainable_parameters(self): | CODE |
| LOW | tests/test_mixed.py | 696 | def test_bias_only_honored_for_non_lora_tuner(self): | CODE |
| LOW | tests/test_mixed.py | 707 | def test_incompatible_config_raises(self): | CODE |
| LOW⚡ | tests/test_seq_classifier.py | 327 | def prepare_inputs_for_testing(self): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 334 | def test_attributes_parametrized(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 344 | def test_prepare_for_training_parametrized(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 349 | def test_prompt_tuning_text_prepare_for_training(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 366 | def test_save_pretrained_pickle(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 372 | def test_save_pretrained_selected_adapters(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 378 | def test_save_pretrained_selected_adapters_pickle(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 386 | def test_from_pretrained_config_construction(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 391 | def test_modules_to_save_correctly_set(self, model_id, config_cls, config_kwargs): | STRING |
| LOW | tests/test_lora_conversion.py | 78 | def test_no_peft_layer_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 85 | def test_prompt_learning_model_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 96 | def test_peft_model_but_no_support_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 106 | def test_model_with_unsupported_layers_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 122 | def test_targeted_modules_identical(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 138 | def test_targeted_modules_identical_target_modules_str(self): | CODE |
| LOW | tests/test_lora_conversion.py | 157 | def test_fixed_rank_lora_config(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 167 | def test_dynamic_rank_lora_config(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 193 | def test_threshold_wrong_value_raises(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 203 | def test_rank_higher_than_weight_dim_raises(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 214 | def test_converting_transformers_model_works(self, lokr_model, tmp_path): | CODE |
| LOW | tests/test_lora_conversion.py | 245 | def test_converted_lora_approximates_original_adapter(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 334 | def test_model_without_peft_config(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 372 | def test_converted_lora_to_lora_works_and_warns(self): | CODE |
| LOW | tests/test_lora_conversion.py | 410 | def test_converted_lora_with_multiple_adapters(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 456 | def test_convert_model_with_modules_to_save(self): | CODE |
| LOW | tests/test_lora_conversion.py | 496 | def test_convert_model_with_trainable_bias_raises(self, bias): | CODE |
| LOW | tests/test_lora_conversion.py | 605 | def test_miss_supports_lora_conversion(self, miss_model_standard, miss_model_mini, miss_model_bat): | CODE |
| LOW | tests/test_lora_conversion.py | 610 | def test_miss_standard_exact_conversion(self, miss_model_standard): | CODE |
| LOW | tests/test_lora_conversion.py | 627 | def test_miss_mini_exact_conversion(self, miss_model_mini): | CODE |
| LOW | tests/test_lora_conversion.py | 644 | def test_miss_bat_approximate_conversion(self, miss_model_bat): | CODE |
| LOW | tests/test_lora_conversion.py | 666 | def test_miss_targeted_modules_identical(self, miss_model_standard): | CODE |
| LOW⚡ | tests/test_tuners_utils.py | 460 | def test_one_targeted_module_regex(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 465 | def test_two_targeted_module_regex(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 470 | def test_one_targeted_module_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 475 | def test_two_targeted_module_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 578 | def test_two_excluded_module_regex(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 583 | def test_two_excluded_module_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 588 | def test_multiple_excluded_modules_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 846 | def test_available_adapters_small(self, small_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 852 | def test_available_adapters_large(self, large_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 858 | def test_devices_all_cpu_small(self, small_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 864 | def test_devices_all_cpu_large(self, large_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 950 | def test_target_parameters_and_target_modules(self, large_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 960 | def test_quantization_backend_small(self, small_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 965 | def test_quantization_backend_large(self, large_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 971 | def test_quantization_backend_bnb(self, small_base_model_cls): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1007 | def test_base_model_type_small(self, small_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1011 | def test_base_model_type_large(self, large_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1015 | def test_base_model_type_transformers_automodel(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1024 | def test_adapter_model_type_small(self, small_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1028 | def test_adapter_model_type_large(self, large_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1066 | def test_model_disabled_small(self, small_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1071 | def test_model_disabled_large(self, large_model): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 1076 | def test_model_enabled_irregular(self, large_model): | STRING |
| 1229 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_gpu_examples.py | 0 | efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109 | STRING |
| HIGH | tests/test_vision_models.py | 0 | efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109 | STRING |
| HIGH | tests/test_gptqmodel.py | 0 | efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109 | STRING |
| HIGH | tests/test_common_gpu.py | 0 | efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109 | STRING |
| HIGH | tests/test_torch_compile.py | 0 | efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109 | STRING |
| HIGH | docs/source/package_reference/lora.md | 0 | run forward and backward passes for gradient estimation. | STRING |
| HIGH | examples/lora_ga_finetuning/README.md | 0 | run forward and backward passes for gradient estimation. | STRING |
| HIGH | examples/lora_ga_finetuning/lora_ga_finetuning.py | 0 | run forward and backward passes for gradient estimation. | STRING |
| HIGH | examples/boft_controlnet/utils/tracemalloc.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | …_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | examples/deft_dreambooth/train_dreambooth.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | examples/oft_dreambooth/train_dreambooth.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | examples/hra_dreambooth/utils/tracemalloc.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | examples/stable_diffusion/train_dreambooth.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | examples/lora_dreambooth/train_dreambooth.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | examples/boft_dreambooth/utils/tracemalloc.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | …ation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py | 0 | get resident set size memory for the current process | STRING |
| HIGH | examples/waveft_finetuning/waveft_finetuning.py | 0 | below is an instruction that describes a task. write a response that appropriately completes the request. ### instructio | STRING |
| HIGH | examples/hira_finetuning/hira_finetuning.py | 0 | below is an instruction that describes a task. write a response that appropriately completes the request. ### instructio | STRING |
| HIGH | examples/glora_finetuning/glora_finetuning.py | 0 | below is an instruction that describes a task. write a response that appropriately completes the request. ### instructio | STRING |
| HIGH | examples/olora_finetuning/olora_finetuning.py | 0 | below is an instruction that describes a task. write a response that appropriately completes the request. ### instructio | STRING |
| HIGH | examples/shira_finetuning/shira_finetuning.py | 0 | below is an instruction that describes a task. write a response that appropriately completes the request. ### instructio | STRING |
| HIGH | examples/deft_dreambooth/train_dreambooth.py | 0 | a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imag | STRING |
| HIGH | examples/oft_dreambooth/train_dreambooth.py | 0 | a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imag | STRING |
| HIGH | examples/hra_dreambooth/utils/dataset.py | 0 | a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imag | STRING |
| HIGH | examples/stable_diffusion/train_dreambooth.py | 0 | a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imag | STRING |
| HIGH | examples/lora_dreambooth/train_dreambooth.py | 0 | a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imag | STRING |
| HIGH | examples/boft_dreambooth/utils/dataset.py | 0 | a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imag | STRING |
| HIGH | examples/corda_finetuning/corda_finetuning.py | 0 | returns the number of trainable parameters and number of all parameters in the model. | STRING |
| HIGH | src/peft/peft_model.py | 0 | returns the number of trainable parameters and number of all parameters in the model. | STRING |
| HIGH | src/peft/mixed_model.py | 0 | returns the number of trainable parameters and number of all parameters in the model. | STRING |
| HIGH | src/peft/peft_model.py | 0 | deletes an existing adapter. args: adapter_name (str): name of the adapter to be deleted. | STRING |
| HIGH | src/peft/tuners/tuners_utils.py | 0 | deletes an existing adapter. args: adapter_name (str): name of the adapter to be deleted. | STRING |
| HIGH | src/peft/tuners/waveft/model.py | 0 | deletes an existing adapter. args: adapter_name (str): name of the adapter to be deleted. | STRING |
| HIGH | src/peft/utils/other.py | 0 | check if the arguments are compatible with the configs and state of the model | STRING |
| HIGH | src/peft/tuners/road/layer.py | 0 | check if the arguments are compatible with the configs and state of the model | STRING |
| HIGH | src/peft/tuners/lora/layer.py | 0 | check if the arguments are compatible with the configs and state of the model | STRING |
| HIGH | src/peft/tuners/lycoris_utils.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/hra/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/road/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/miss/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/oft/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/vera/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/delora/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/boft/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/waveft/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/c3a/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/hira/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/hira/bnb.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/road/bnb.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/fourierft/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/vblora/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/gralora/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/ia3/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/osf/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/adalora/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/pvera/layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/lora/hqq.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/lora/tp_layer.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| HIGH | src/peft/tuners/lora/inc.py | 0 | merge the active adapter weights into the base weights. args: safe_merge (`bool`, *optional*): if `true`, the merge oper | STRING |
| 57 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | tests/test_lora_conversion.py | 468 | lokr_model.base_model.model.model.decoder.layers[0].fc1.modules_to_save.default.weight.data.mul_(-10.0) | CODE |
| CRITICAL | tests/test_lora_conversion.py | 469 | lokr_model.base_model.model.model.decoder.layers[0].fc1.modules_to_save.default.bias.data.mul_(-10.0) | CODE |
| CRITICAL⚡ | tests/test_cpt.py | 247 | emb = model.prompt_encoder.default.embedding.weight.data.clone().detach() | CODE |
| CRITICAL⚡ | tests/test_cpt.py | 263 | assert torch.all(model.prompt_encoder.default.embedding.weight.data.clone().detach().cpu() == emb.cpu()) | CODE |
| CRITICAL⚡ | tests/test_cpt.py | 277 | emb = model.prompt_encoder.default.embedding.weight.data.clone().detach() | CODE |
| CRITICAL | tests/test_cpt.py | 294 | assert torch.all(model.prompt_encoder.default.embedding.weight.data.clone().detach().cpu() == emb.cpu()) | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 228 | initial_delta = model.model.model.embed_tokens.trainable_tokens_delta.default.clone() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 229 | initial_originals = model.model.model.embed_tokens.trainable_tokens_original.default.clone() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 680 | assert merged_model.model.decoder.embed_tokens.weight.data_ptr() == merged_model.lm_head.weight.data_ptr() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 717 | assert merged_model.model.decoder.embed_tokens.weight.data_ptr() == merged_model.lm_head.weight.data_ptr() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 816 | expected_changed_weights = peft_model.model.model.embed_tokens.trainable_tokens_delta.default.data.clone() | CODE |
| CRITICAL | tests/test_gpu_examples.py | 2231 | embed_params = model.base_model.model.model.decoder.embed_tokens.original_module.weight.numel() | STRING |
| CRITICAL⚡ | tests/test_initialization.py | 5792 | model.base_model.model.model.embed_tokens.weight.data_ptr() | CODE |
| CRITICAL⚡ | tests/test_initialization.py | 5793 | != model.base_model.model.lm_head.weight.data_ptr() | CODE |
| CRITICAL | tests/test_initialization.py | 5264 | peft_model.prompt_encoder.default.embedding.weight.data.fill_(1.0) | CODE |
| CRITICAL | tests/test_initialization.py | 5481 | embed_np = dict(model.base_model.model.model.embed_tokens.named_parameters()) | CODE |
| CRITICAL | tests/test_initialization.py | 5541 | embed_np = dict(model.base_model.model.model.embed_tokens.named_parameters()) | CODE |
| CRITICAL | tests/test_initialization.py | 5716 | shared_np = dict(model.base_model.model.model.shared.named_parameters()) | CODE |
| CRITICAL⚡ | tests/test_target_parameters.py | 384 | gate_proj_1_0.lora_A.default.weight.data.copy_(gate_proj_0_0.lora_A.default.weight.data) | CODE |
| CRITICAL⚡ | tests/test_target_parameters.py | 385 | gate_proj_1_1.lora_A.default.weight.data.copy_(gate_proj_0_1.lora_A.default.weight.data) | CODE |
| CRITICAL⚡ | tests/test_target_parameters.py | 386 | gate_proj_1_0.lora_B.default.weight.data.copy_(gate_proj_0_0.lora_B.default.weight.data) | CODE |
| CRITICAL⚡ | tests/test_target_parameters.py | 387 | gate_proj_1_1.lora_B.default.weight.data.copy_(gate_proj_0_1.lora_B.default.weight.data) | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 821 | layers[0].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 822 | == layers[1].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 823 | and layers[2].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 824 | == layers[3].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 827 | layers[0].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 828 | != layers[2].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 831 | layers[0].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 832 | != layers[1].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 833 | and layers[2].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 834 | != layers[3].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL | tests/test_custom_models.py | 4051 | lm_head_keys = list(model.base_model.model.lm_head.modules_to_save.keys()) | CODE |
| CRITICAL | tests/test_custom_models.py | 4054 | embed_token_keys = list(model.base_model.model.model.decoder.embed_tokens.modules_to_save.keys()) | CODE |
| CRITICAL | src/peft/tuners/tuners_utils.py | 619 | model.lm_head.weight.data = model.model.embed_tokens.weight.data.clone() | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_lorafa.py | 15 | CODE | |
| LOW | tests/test_trainable_tokens.py | 15 | CODE | |
| LOW | tests/test_loraplus.py | 14 | CODE | |
| LOW | method_comparison/app_embed.py | 26 | CODE | |
| LOW | method_comparison/app_embed.py | 26 | CODE | |
| LOW | examples/stable_diffusion/inc_flux_lora_hpu.py | 26 | CODE | |
| LOW | src/peft/config.py | 14 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 17 | CODE | |
| LOW | src/peft/__init__.py | 27 | CODE | |
| LOW | src/peft/__init__.py | 27 | CODE | |
| LOW | src/peft/__init__.py | 28 | CODE | |
| LOW | src/peft/__init__.py | 29 | CODE | |
| LOW | src/peft/__init__.py | 29 | CODE | |
| LOW | src/peft/__init__.py | 29 | CODE | |
| LOW | src/peft/__init__.py | 29 | CODE | |
| LOW | src/peft/__init__.py | 29 | CODE | |
| LOW | src/peft/__init__.py | 36 | CODE | |
| LOW | src/peft/__init__.py | 37 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 38 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| LOW | src/peft/__init__.py | 49 | CODE | |
| 529 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 1 | # Copyright 2023 The HuggingFace Team. All rights reserved. | COMMENT |
| LOW | setup.py | 101 | # Push the tag to git: | COMMENT |
| LOW | tests/test_mixed.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_seq_classifier.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_lora_conversion.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_tuners_utils.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_tuners_utils.py | 61 | from .testing_utils import hub_online_once, require_bitsandbytes, require_non_cpu | COMMENT |
| LOW | tests/test_tuners_utils.py | 1981 | super().__init__() | COMMENT |
| LOW | tests/conftest.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_xlora.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_hub_features.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_lorafa.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_cpt.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_low_level_api.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_lora_megatron.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_trainable_tokens.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_gpu_examples.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_integrations.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_poly.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/testing_utils.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_loraplus.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_adaption_prompt.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_frod.py | 1 | # Copyright 2026-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_initialization.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_initialization.py | 5041 | # (proj): Conv3d(3, 1280, kernel_size=(2, 14, 14), stride=(2, 14, 14), bias=False) | COMMENT |
| LOW | tests/test_initialization.py | 5061 | # (mlp): Sequential( | COMMENT |
| LOW | tests/test_initialization.py | 5081 | # (up_proj): Linear(in_features=1536, out_features=8960, bias=False) | COMMENT |
| LOW | tests/test_initialization.py | 5121 | return model | COMMENT |
| LOW | tests/test_initialization.py | 5141 | # (mlp): VisionMlp( | COMMENT |
| LOW | tests/test_initialization.py | 5161 | # (self_attn): Qwen2VLAttention( | COMMENT |
| LOW | tests/test_target_parameters.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_pvera.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_vision_models.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_gptqmodel.py | 1 | # Note: These tests were copied from test_common_gpu.py and test_gpu_examples.py as they can run on CPU too. | COMMENT |
| LOW | tests/test_decoder_models.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_encoder_decoder_models.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_multitask_prompt_tuning.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_lora_ga.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/testing_common.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_quantization.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_common_gpu.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_cartridge.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_vblora.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_config.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_randlora.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_unilora.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_shira.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_boft.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_feature_extraction_models.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_bdlora.py | 1 | # Copyright 2026-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_helpers.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_stablediffusion.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_lora_variants.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_incremental_pca.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_auto.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_deft.py | 1 | # Copyright 2026-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_other.py | 1 | # Copyright 2023-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_arrow.py | 1 | # Copyright 2025-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_vera.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_torch_compile.py | 1 | # Copyright 2024-present the HuggingFace Inc. team. | COMMENT |
| 322 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_lora_conversion.py | 576 | CODE | |
| LOW | tests/test_trainable_tokens.py | 586 | CODE | |
| LOW | tests/test_gpu_examples.py | 6646 | CODE | |
| LOW | tests/test_gpu_examples.py | 6700 | CODE | |
| LOW | tests/test_gpu_examples.py | 5933 | CODE | |
| LOW | tests/testing_utils.py | 318 | CODE | |
| LOW | tests/test_initialization.py | 1487 | CODE | |
| LOW | tests/test_initialization.py | 4465 | CODE | |
| LOW | tests/test_initialization.py | 4642 | CODE | |
| LOW | tests/test_initialization.py | 4674 | CODE | |
| LOW | tests/test_decoder_models.py | 442 | CODE | |
| LOW | tests/testing_common.py | 588 | CODE | |
| LOW | tests/testing_common.py | 1038 | CODE | |
| LOW | tests/testing_common.py | 1196 | CODE | |
| LOW | tests/testing_common.py | 1300 | CODE | |
| LOW | tests/testing_common.py | 1332 | CODE | |
| LOW | tests/testing_common.py | 1392 | CODE | |
| LOW | tests/testing_common.py | 1501 | CODE | |
| LOW | tests/test_other.py | 655 | CODE | |
| LOW | tests/test_arrow.py | 474 | CODE | |
| LOW | tests/test_custom_models.py | 2723 | CODE | |
| LOW | tests/test_custom_models.py | 2842 | CODE | |
| LOW | method_comparison/app_embed.py | 38 | CODE | |
| LOW | method_comparison/sanitizer.py | 6 | CODE | |
| LOW | method_comparison/app.py | 280 | CODE | |
| LOW | method_comparison/image-gen/run.py | 159 | CODE | |
| LOW | method_comparison/image-gen/utils.py | 314 | CODE | |
| LOW | method_comparison/text_generation_benchmark/run.py | 139 | CODE | |
| LOW | method_comparison/text_generation_benchmark/utils.py | 205 | CODE | |
| LOW | method_comparison/peft-shop/app.py | 1110 | CODE | |
| LOW | method_comparison/MetaMathQA/utils.py | 210 | CODE | |
| LOW | method_comparison/MetaMathQA/utils.py | 359 | CODE | |
| LOW | …les/sequence_classification/peft_no_lora_accelerate.py | 79 | CODE | |
| LOW | examples/boft_controlnet/train_controlnet.py | 86 | CODE | |
| LOW | examples/boft_controlnet/utils/pipeline_controlnet.py | 53 | CODE | |
| LOW | examples/boft_controlnet/utils/pipeline_controlnet.py | 166 | CODE | |
| LOW | examples/boft_controlnet/utils/dataset.py | 82 | CODE | |
| LOW | examples/boft_controlnet/utils/dataset.py | 136 | CODE | |
| LOW | …ture_extraction/peft_lora_embedding_semantic_search.py | 210 | CODE | |
| LOW | …_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py | 110 | CODE | |
| LOW | examples/arrow_multitask/arrow_phi3_mini.py | 120 | CODE | |
| LOW | examples/loftq_finetuning/int8_correction.py | 68 | CODE | |
| LOW | examples/loftq_finetuning/train_gsm8k_llama.py | 297 | CODE | |
| LOW | …orthogonal_subspace_learning/osf_continual_learning.py | 51 | CODE | |
| LOW | …orthogonal_subspace_learning/osf_continual_learning.py | 99 | CODE | |
| LOW | …orthogonal_subspace_learning/osf_continual_learning.py | 142 | CODE | |
| LOW | examples/orthogonal_subspace_learning/utils.py | 42 | CODE | |
| LOW | examples/deft_dreambooth/train_dreambooth.py | 585 | CODE | |
| LOW | examples/oft_dreambooth/train_dreambooth.py | 590 | CODE | |
| LOW | examples/hra_dreambooth/train_dreambooth.py | 82 | CODE | |
| LOW | examples/qalora_finetuning/qalora_gptq_finetuning.py | 23 | CODE | |
| LOW | examples/stable_diffusion/train_dreambooth.py | 754 | CODE | |
| LOW | examples/stable_diffusion/convert_sd_adapter_to_peft.py | 285 | CODE | |
| LOW | examples/lora_dreambooth/train_dreambooth.py | 580 | CODE | |
| LOW | examples/corda_finetuning/datautils.py | 106 | CODE | |
| LOW | examples/sft/utils.py | 86 | CODE | |
| LOW | examples/boft_dreambooth/train_dreambooth.py | 82 | CODE | |
| LOW | …ation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py | 104 | CODE | |
| LOW | …s/int8_training/peft_adalora_whisper_large_training.py | 423 | CODE | |
| LOW | scripts/log_reports.py | 19 | CODE | |
| 198 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | method_comparison/app.py | 46 | logger = logging.getLogger(__name__) | CODE |
| LOW | method_comparison/peft-shop/app.py | 294 | def _set_data(data: dict[str, Any]) -> None: | CODE |
| LOW | examples/stable_diffusion/convert_sd_adapter_to_peft.py | 20 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/peft/__init__.py | 175 | __all__ = [ | CODE |
| LOW | src/peft/peft_model.py | 1578 | def set_adapter(self, adapter_name: str, inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/peft_model.py | 1603 | def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | CODE |
| LOW | src/peft/functional.py | 26 | __all__ = [ | CODE |
| LOW | src/peft/mixed_model.py | 251 | def set_modules_to_save(self, peft_config: PeftConfig, adapter_name: str) -> None: | CODE |
| LOW | src/peft/mixed_model.py | 266 | def set_adapter(self, adapter_name: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/helpers.py | 38 | def update_forward_signature(model: PeftModel) -> None: | CODE |
| LOW | src/peft/helpers.py | 72 | def update_generate_signature(model: PeftModel) -> None: | CODE |
| LOW | src/peft/helpers.py | 113 | def update_signature(model: PeftModel, method: str = "all") -> None: | CODE |
| LOW | src/peft/utils/__init__.py | 85 | __all__ = [ | CODE |
| LOW | src/peft/utils/other.py | 91 | __all__ = [ | CODE |
| LOW | src/peft/utils/other.py | 521 | def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 547 | def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | CODE |
| LOW | src/peft/utils/other.py | 700 | def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 944 | def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 1124 | def _set_adapter(model, adapter_name: str | list[str], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 277 | def _set_layer_requires_grad(layer, requires_grad: bool) -> None: | STRING |
| LOW | src/peft/utils/quantization_utils.py | 75 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 116 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 137 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 159 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 191 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 233 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/tuners/__init__.py | 78 | __all__ = [ | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 1265 | def set_adapter(self, adapter_name: str | list[str], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 1609 | def set_adapter(self, adapter_names: str | list[str], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 1689 | def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 2291 | def set_requires_grad(model, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 553 | def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | STRING |
| LOW | src/peft/tuners/tuners_utils.py | 1459 | def set_base_weight(self, weight_data: torch.Tensor) -> None: | STRING |
| LOW | src/peft/tuners/peanut/__init__.py | 22 | __all__ = ["Linear", "PeanutConfig", "PeanutLayer", "PeanutModel"] | CODE |
| LOW | src/peft/tuners/prompt_tuning/__init__.py | 21 | __all__ = ["PromptEmbedding", "PromptTuningConfig", "PromptTuningInit"] | CODE |
| LOW | src/peft/tuners/hra/__init__.py | 22 | __all__ = ["HRAConfig", "HRAConv2d", "HRALayer", "HRALinear", "HRAModel"] | CODE |
| LOW | src/peft/tuners/loha/__init__.py | 22 | __all__ = ["Conv2d", "Linear", "LoHaConfig", "LoHaLayer", "LoHaModel"] | CODE |
| LOW | src/peft/tuners/lokr/__init__.py | 22 | __all__ = ["Conv2d", "Linear", "LoKrConfig", "LoKrLayer", "LoKrModel"] | CODE |
| LOW | src/peft/tuners/vera/__init__.py | 22 | __all__ = ["Linear", "VeraConfig", "VeraLayer", "VeraModel"] | CODE |
| LOW | src/peft/tuners/ln_tuning/__init__.py | 21 | __all__ = ["LNTuningConfig", "LNTuningModel"] | CODE |
| LOW | src/peft/tuners/cpt/__init__.py | 22 | __all__ = ["CPTConfig", "CPTEmbedding"] | CODE |
| LOW | src/peft/tuners/delora/__init__.py | 21 | __all__ = ["DeloraConfig", "DeloraLayer", "DeloraLinear", "DeloraModel"] | CODE |
| LOW | src/peft/tuners/boft/__init__.py | 22 | __all__ = ["BOFTConfig", "BOFTLayer", "BOFTModel"] | CODE |
| LOW | src/peft/tuners/psoft/__init__.py | 22 | __all__ = ["Linear", "PsoftConfig", "PsoftLayer", "PsoftModel"] | CODE |
| LOW⚡ | src/peft/tuners/psoft/layer.py | 235 | def _set_psoft_ab_cache_buffers(self, adapter_name: str, A: torch.Tensor, B: torch.Tensor) -> None: | CODE |
| LOW⚡ | src/peft/tuners/psoft/layer.py | 239 | def update_layer(self, adapter_name: str, config: PsoftConfig, **kwargs: Any) -> None: | CODE |
| LOW | src/peft/tuners/beft/__init__.py | 23 | __all__ = ["BeftConfig", "BeftLayer", "BeftModel", "Linear"] | CODE |
| LOW | src/peft/tuners/waveft/__init__.py | 22 | __all__ = ["WaveFTConfig", "WaveFTLayer", "WaveFTLinear", "WaveFTModel"] | CODE |
| LOW | src/peft/tuners/c3a/__init__.py | 21 | __all__ = ["C3AConfig", "C3ALayer", "C3ALinear", "C3AModel"] | CODE |
| LOW | src/peft/tuners/p_tuning/__init__.py | 21 | __all__ = ["PromptEncoder", "PromptEncoderConfig", "PromptEncoderReparameterizationType"] | CODE |
| LOW | src/peft/tuners/adamss/__init__.py | 22 | __all__ = [ | CODE |
| LOW | src/peft/tuners/adamss/model.py | 157 | def update_and_allocate(self, global_step: int) -> None: | CODE |
| LOW | src/peft/tuners/hira/__init__.py | 23 | __all__ = [ | CODE |
| LOW | src/peft/tuners/hira/layer.py | 309 | def update_layer(self, adapter_name, r, config: HiraConfig, **kwargs) -> None: | CODE |
| LOW | src/peft/tuners/mixed/__init__.py | 18 | __all__ = ["COMPATIBLE_TUNER_TYPES", "MixedModel"] | CODE |
| LOW | src/peft/tuners/mixed/model.py | 201 | def set_adapter(self, adapter_name: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/tuners/frod/__init__.py | 22 | __all__ = ["FrodConfig", "FrodLayer", "FrodModel", "Linear"] | CODE |
| LOW | src/peft/tuners/trainable_tokens/__init__.py | 22 | __all__ = [ | CODE |
| LOW | src/peft/tuners/road/__init__.py | 26 | __all__ = [ | CODE |
| LOW | src/peft/tuners/fourierft/__init__.py | 22 | __all__ = ["FourierFTConfig", "FourierFTLayer", "FourierFTLinear", "FourierFTModel"] | CODE |
| 33 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_trainable_tokens.py | 1205 | # Create a composite model with two BART sub-models | COMMENT |
| MEDIUM | tests/test_lora_ga.py | 130 | # Create a fresh model and load the saved state | COMMENT |
| MEDIUM | tests/test_helpers.py | 669 | # Create a minimal dummy MoE model with fused 3D weights | COMMENT |
| MEDIUM | tests/test_custom_models.py | 4628 | # Create a weighted adapter combining both adapters and check that its output is same as setting multiple | COMMENT |
| MEDIUM | method_comparison/app_embed.py | 58 | # Create an empty figure. | COMMENT |
| MEDIUM | method_comparison/app.py | 57 | # Create an empty figure. | COMMENT |
| MEDIUM | examples/boft_controlnet/train_controlnet.py | 537 | # Create the pipeline using using the trained modules and save it. | COMMENT |
| MEDIUM | examples/arrow_multitask/arrow_phi3_mini.py | 362 | # Creating the Arrow model | COMMENT |
| MEDIUM | …orthogonal_subspace_learning/osf_continual_learning.py | 57 | # Create a simple dataloader | COMMENT |
| MEDIUM | examples/deft_dreambooth/train_dreambooth.py | 1072 | # Create the pipeline using using the trained modules and save it. | COMMENT |
| MEDIUM | examples/oft_dreambooth/train_dreambooth.py | 1079 | # Create the pipeline using using the trained modules and save it. | COMMENT |
| MEDIUM | examples/hra_dreambooth/train_dreambooth.sh | 4 | # Define the UNIQUE_TOKEN, CLASS_TOKENs, and SUBJECT_NAMES | COMMENT |
| MEDIUM | examples/stable_diffusion/train_dreambooth.py | 1239 | # Create the pipeline using using the trained modules and save it. | COMMENT |
| MEDIUM | examples/stable_diffusion/convert_sd_adapter_to_peft.py | 409 | # Create a corresponding adapter info | COMMENT |
| MEDIUM | examples/lora_dreambooth/train_dreambooth.py | 1071 | # Create the pipeline using using the trained modules and save it. | COMMENT |
| MEDIUM | examples/boft_dreambooth/train_dreambooth.sh | 5 | # Define the UNIQUE_TOKEN, CLASS_TOKENs, and SUBJECT_NAMES | COMMENT |
| MEDIUM | examples/lora_ga_finetuning/lora_ga_finetuning.py | 167 | # Create a simple DataLoader for gradient estimation | COMMENT |
| MEDIUM | src/peft/utils/other.py | 1667 | # Create the causal mask with fixed shape in advance, to reduce recompilations. If the function to create | COMMENT |
| MEDIUM | src/peft/tuners/tuners_utils.py | 1858 | # Create a reverse lookup for other_module_names to quickly check suffix matches | COMMENT |
| MEDIUM | src/peft/tuners/boft/layer.py | 178 | # Create a mask with 1s for matrices to be replaced with identity and 0s otherwise | COMMENT |
| MEDIUM | src/peft/tuners/waveft/layer.py | 133 | # Create a padded spectrum matrix with additional rows and columns | COMMENT |
| MEDIUM | src/peft/tuners/waveft/layer.py | 144 | # Create the padded dense spectrum matrix | COMMENT |
| MEDIUM | src/peft/tuners/waveft/waverec2d.py | 6 | # This file contains code derived from PyTorch-Wavelet-Toolbox: | COMMENT |
| MEDIUM | src/peft/tuners/osf/model.py | 103 | # Create a new or update an existing OSF layer in place | COMMENT |
| MEDIUM | src/peft/tuners/xlora/model.py | 244 | # Create an empty LoraModel | COMMENT |
| MEDIUM | src/peft/tuners/adalora/model.py | 348 | """This method is not supported for AdaLoRA, use LoRA instead.""" | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/testing_utils.py | 370 | except Exception: | CODE |
| MEDIUM | tests/test_initialization.py | 311 | def test_lora_init_orthogonal_half_precision_dtype(self, dtype): | CODE |
| LOW | tests/test_initialization.py | 314 | except Exception: | CODE |
| LOW | tests/test_arrow.py | 336 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 2500 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 2540 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 2579 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 2618 | except Exception: | CODE |
| LOW | method_comparison/app.py | 188 | except Exception as exc: | CODE |
| LOW | method_comparison/app.py | 198 | except Exception as exc: | CODE |
| LOW | method_comparison/app.py | 232 | except Exception as exc: | CODE |
| LOW | method_comparison/app.py | 393 | except Exception as exc: | CODE |
| LOW | method_comparison/app.py | 443 | except Exception as exc: | CODE |
| LOW | method_comparison/app.py | 496 | except Exception as e: | CODE |
| LOW | method_comparison/app.py | 518 | except Exception as e: | CODE |
| LOW | method_comparison/image-gen/run.py | 510 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/run.py | 631 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/utils.py | 302 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/utils.py | 310 | except Exception as exc: | CODE |
| LOW⚡ | method_comparison/image-gen/utils.py | 326 | except Exception as exc: | CODE |
| LOW⚡ | method_comparison/image-gen/utils.py | 334 | except Exception as exc: | CODE |
| LOW⚡ | method_comparison/image-gen/utils.py | 342 | except Exception as exc: | CODE |
| LOW⚡ | method_comparison/image-gen/utils.py | 350 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/evaluate.py | 131 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/evaluate.py | 231 | except Exception as exc: | CODE |
| LOW | method_comparison/text_generation_benchmark/run.py | 214 | except Exception as exc: | CODE |
| LOW | method_comparison/text_generation_benchmark/run.py | 299 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/run.py | 386 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 355 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 371 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 379 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 508 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 516 | except Exception as exc: | CODE |
| LOW | examples/ephemeral_gpu_offloading/load_with_dora.py | 75 | except Exception as e: | CODE |
| LOW | examples/ephemeral_gpu_offloading/load_with_dora.py | 80 | except Exception as e: | CODE |
| LOW | examples/qalora_finetuning/qalora_gptq_finetuning.py | 69 | except Exception as e: | CODE |
| LOW | examples/adamss_finetuning/test_adamss_quick.py | 169 | except Exception as e: | CODE |
| LOW | scripts/generate_method_capabilities.py | 283 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 303 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 326 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 362 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 394 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 460 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 514 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 580 | except Exception as exc: | CODE |
| LOW | scripts/generate_method_capabilities.py | 588 | except Exception as exc: | CODE |
| MEDIUM | scripts/generate_method_capabilities.py | 352 | def run(self) -> Finding: | CODE |
| LOW | src/peft/config.py | 116 | except Exception: | STRING |
| LOW | src/peft/config.py | 258 | except Exception as exc: | STRING |
| LOW | src/peft/config.py | 322 | except Exception: | STRING |
| MEDIUM | src/peft/peft_model.py | 176 | def active_adapters(self) -> list[str]: | CODE |
| LOW | src/peft/peft_model.py | 1160 | except Exception: # something went wrong, roll back | CODE |
| LOW | src/peft/mixed_model.py | 242 | except Exception: # something went wrong, roll back | CODE |
| LOW | src/peft/helpers.py | 162 | except Exception: | CODE |
| LOW | src/peft/utils/other.py | 1476 | except Exception as e: | CODE |
| LOW | src/peft/tuners/boft/layer.py | 97 | except Exception as e: | CODE |
| LOW | src/peft/tuners/adamss/layer.py | 180 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_arrow.py | 30 | # ─── Fixtures ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | examples/KappaTune/experiments_kappatune_peft.py | 19 | # ========================================== | COMMENT |
| MEDIUM | examples/KappaTune/experiments_kappatune_peft.py | 21 | # ========================================== | COMMENT |
| MEDIUM | examples/KappaTune/experiments_kappatune_peft.py | 47 | # ========================================== | COMMENT |
| MEDIUM | examples/KappaTune/experiments_kappatune_peft.py | 49 | # ========================================== | COMMENT |
| MEDIUM | examples/KappaTune/experiments_kappatune_peft.py | 146 | # ========================================== | COMMENT |
| MEDIUM | examples/KappaTune/experiments_kappatune_peft.py | 148 | # ========================================== | COMMENT |
| MEDIUM⚡ | …etuning/sequence_classification_finetune_monteclora.py | 21 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | …etuning/sequence_classification_finetune_monteclora.py | 23 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | …etuning/sequence_classification_finetune_monteclora.py | 29 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | …etuning/sequence_classification_finetune_monteclora.py | 31 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM | …etuning/sequence_classification_finetune_monteclora.py | 42 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM | …etuning/sequence_classification_finetune_monteclora.py | 44 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM | …etuning/sequence_classification_finetune_monteclora.py | 162 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM | …etuning/sequence_classification_finetune_monteclora.py | 164 | # ---------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/peft/tuners/lora/layer.py | 863 | # ------------------------------------------------------------------------------------------ | COMMENT |
| MEDIUM | src/peft/tuners/lora/layer.py | 866 | # ------------------------------------------------------------------------------------------ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/testing_utils.py | 286 | CODE | |
| LOW | tests/test_lora_variants.py | 73 | CODE | |
| LOW | tests/test_torch_compile.py | 146 | CODE | |
| LOW | method_comparison/text_generation_benchmark/run_base.py | 122 | CODE | |
| LOW | method_comparison/text_generation_benchmark/utils.py | 279 | CODE | |
| LOW | examples/boft_controlnet/utils/pipeline_controlnet.py | 166 | CODE | |
| LOW | examples/boft_controlnet/utils/unet_2d_condition.py | 38 | CODE | |
| LOW | examples/waveft_finetuning/waveft_finetuning.py | 30 | CODE | |
| LOW | examples/hira_finetuning/hira_finetuning.py | 26 | CODE | |
| LOW | examples/glora_finetuning/glora_finetuning.py | 26 | CODE | |
| LOW | examples/olora_finetuning/olora_finetuning.py | 30 | CODE | |
| LOW | examples/shira_finetuning/shira_finetuning.py | 31 | CODE | |
| LOW | examples/corda_finetuning/datautils.py | 95 | CODE | |
| LOW | scripts/train_memory.py | 106 | CODE | |
| LOW | src/peft/peft_model.py | 1870 | CODE | |
| LOW | src/peft/peft_model.py | 2053 | CODE | |
| LOW | src/peft/peft_model.py | 2397 | CODE | |
| LOW | src/peft/peft_model.py | 2724 | CODE | |
| LOW | src/peft/peft_model.py | 2954 | CODE | |
| LOW | src/peft/peft_model.py | 3025 | CODE | |
| LOW | src/peft/utils/incremental_pca.py | 46 | CODE | |
| LOW | src/peft/tuners/hra/layer.py | 268 | CODE | |
| LOW | src/peft/tuners/hra/layer.py | 458 | CODE | |
| LOW | src/peft/tuners/loha/layer.py | 244 | CODE | |
| LOW | src/peft/tuners/lokr/layer.py | 314 | CODE | |
| LOW | src/peft/tuners/vera/layer.py | 289 | CODE | |
| LOW | src/peft/tuners/delora/layer.py | 267 | CODE | |
| LOW | src/peft/tuners/boft/layer.py | 651 | CODE | |
| LOW | src/peft/tuners/boft/layer.py | 994 | CODE | |
| LOW | src/peft/tuners/waveft/layer.py | 289 | CODE | |
| LOW | src/peft/tuners/c3a/layer.py | 202 | CODE | |
| LOW | src/peft/tuners/frod/layer.py | 346 | CODE | |
| LOW | src/peft/tuners/road/layer.py | 397 | CODE | |
| LOW | src/peft/tuners/fourierft/layer.py | 191 | CODE | |
| LOW | src/peft/tuners/vblora/layer.py | 253 | CODE | |
| LOW | src/peft/tuners/gralora/layer.py | 387 | CODE | |
| LOW | src/peft/tuners/adaption_prompt/layer.py | 139 | CODE | |
| LOW | src/peft/tuners/unilora/layer.py | 252 | CODE | |
| LOW | src/peft/tuners/tinylora/layer.py | 414 | CODE | |
| LOW | src/peft/tuners/miss/layer.py | 367 | CODE | |
| LOW | src/peft/tuners/ia3/layer.py | 319 | CODE | |
| LOW | src/peft/tuners/xlora/layer.py | 131 | CODE | |
| LOW | src/peft/tuners/xlora/layer.py | 236 | CODE | |
| LOW | src/peft/tuners/pvera/layer.py | 312 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 246 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 345 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 434 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 889 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 1218 | CODE | |
| LOW | src/peft/tuners/lora/eva.py | 655 | CODE | |
| LOW | src/peft/tuners/lora/layer.py | 740 | CODE | |
| LOW | src/peft/tuners/lora/layer.py | 2153 | CODE | |
| LOW | src/peft/tuners/randlora/layer.py | 346 | CODE | |
| LOW | src/peft/tuners/oft/awq.py | 69 | CODE | |
| LOW | src/peft/tuners/oft/gptq.py | 67 | CODE | |
| LOW | src/peft/tuners/oft/layer.py | 687 | CODE | |
| LOW | src/peft/tuners/oft/layer.py | 940 | CODE | |
| LOW | src/peft/tuners/deft/layer.py | 345 | CODE | |
| LOW | src/peft/tuners/poly/layer.py | 161 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test_xlora.py | 317 | # Set it to 2 and make sure it actually is | COMMENT |
| LOW⚡ | tests/test_xlora.py | 322 | # Set it to None and make sure it is 1/n | COMMENT |
| LOW⚡ | tests/test_lorafa.py | 212 | # Check if lora_A weights have not changed | COMMENT |
| LOW⚡ | tests/test_lorafa.py | 217 | # Check if lora_B weights are non-zero | COMMENT |
| LOW⚡ | tests/test_lorafa.py | 243 | # Check if lora_A weights have not changed | COMMENT |
| LOW⚡ | tests/test_lorafa.py | 248 | # Check if lora_B weights are non-zero and if they follow the expected relation | COMMENT |
| LOW | tests/test_lorafa.py | 280 | # Check if all non-LoRA params also follow the expected relation | COMMENT |
| LOW⚡ | tests/test_config.py | 438 | # Check if the user supplied timing values that will certainly fail because it breaks | STRING |
| LOW | method_comparison/MetaMathQA/utils.py | 440 | # Check if the string represents a fraction. | COMMENT |
| LOW | examples/waveft_finetuning/waveft_finetuning.py | 50 | # Set device_map to the right place when enabling DDP. | COMMENT |
| LOW | examples/olora_finetuning/olora_finetuning.py | 51 | # Set device_map to the right place when enabling DDP. | COMMENT |
| LOW | examples/alora_finetuning/alora_finetuning.py | 186 | # Print results | COMMENT |
| LOW | examples/qalora_finetuning/qalora_gptq_finetuning.py | 50 | # Check if the model has GPTQ quantization attributes | COMMENT |
| LOW | examples/qalora_finetuning/qalora_gptq_finetuning.py | 78 | # Check if we already have a cached quantized version | COMMENT |
| LOW | examples/shira_finetuning/shira_finetuning.py | 49 | # Set device_map to the right place when enabling DDP. | COMMENT |
| LOW | examples/sft/utils.py | 194 | # Check if the model is quantized | COMMENT |
| LOW | …s/int8_training/peft_adalora_whisper_large_training.py | 707 | # Check if rank_pattern exists before calling update_and_allocate | COMMENT |
| LOW⚡ | src/peft/utils/other.py | 1574 | # Check if this is the embedding layer (use endswith to allow flexible matching) | COMMENT |
| LOW⚡ | src/peft/utils/other.py | 1579 | # Check if this target layer matches any tied module (considering nested structures) | COMMENT |
| LOW⚡ | src/peft/utils/other.py | 1587 | # Check if all tied layers have the same indices | COMMENT |
| LOW | src/peft/tuners/tuners_utils.py | 1875 | # Check if adding this suffix covers the item | COMMENT |
| LOW | src/peft/tuners/adamss/model.py | 98 | # Check if already an Adamss layer | COMMENT |
| LOW | src/peft/tuners/hira/layer.py | 138 | fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out) | CODE |
| LOW | src/peft/tuners/hira/layer.py | 299 | fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out) | CODE |
| LOW | src/peft/tuners/adalora/config.py | 94 | # Check if 'r' has been set to a non-default value | COMMENT |
| LOW | src/peft/tuners/lora/loraga.py | 136 | # Check if any supported layers were found | COMMENT |
| LOW | src/peft/tuners/oft/layer.py | 548 | fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out) | CODE |
| LOW | src/peft/tuners/oft/layer.py | 703 | fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_trainable_tokens.py | 664 | # for this we can leverage the fact that emb_out(1/emb_in(x)) is embed_dim on the | COMMENT |
| MEDIUM | tests/test_trainable_tokens.py | 701 | # for this we can leverage the fact that emb_out(1/emb_in(x)) is embed_dim on the | COMMENT |
| MEDIUM | tests/test_trainable_tokens.py | 762 | # for this we can leverage the fact that emb_out(1/emb_in(x)) is embed_dim on the | COMMENT |
| MEDIUM⚡ | tests/test_gpu_examples.py | 5806 | # increase the scale of the LoRA weights so that the difference between adapters is more pronounced, making | COMMENT |
| MEDIUM⚡ | tests/test_initialization.py | 1556 | # some arguments don't work in conjunction with lora_bias and should raise | COMMENT |
| LOW | tests/test_decoder_models.py | 522 | # a malicious prompt tuning model. This is because PEFT would just pass the on the tokenizer_kwargs defined in | COMMENT |
| LOW | tests/test_other.py | 409 | # aware that some of the passing tests may just pass owing to randomness. | COMMENT |
| LOW | examples/dora_finetuning/dora_finetuning.py | 73 | use_dora=use_dora, # to use Dora OR compare to Lora just set the --use_dora | CODE |
| MEDIUM | src/peft/peft_model.py | 1046 | # TODO: consider replacing this patching of methods with a more robust mechanism: setting a flag and | COMMENT |
| LOW | src/peft/utils/other.py | 1764 | # technically it would be sufficient to just return candidates since that contains all the keys of | COMMENT |
| LOW | src/peft/utils/transformers_weight_conversion.py | 493 | # If, for any reason, we cannot apply conversion, we just return the PEFT config as is. | COMMENT |
| MEDIUM | src/peft/tuners/tuners_utils.py | 875 | # TODO: check if this the most robust way | STRING |
| LOW | src/peft/tuners/tuners_utils.py | 301 | # model, just add a `peft_config` dict attribute to your model. | STRING |
| LOW | src/peft/tuners/adamss/layer.py | 395 | # so just call base_layer directly (no adapter delta needed). | COMMENT |
| LOW | src/peft/tuners/lora/conversion.py | 329 | # effective rank is the same and target_modules are a set, just add the name | COMMENT |
| MEDIUM | src/peft/tuners/lora/layer.py | 387 | # check without importing bitsandbytes and robust to bnb_4bit_quant_storage=float* | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | examples/boft_controlnet/utils/pipeline_controlnet.py | 196 | Function invoked when calling the pipeline for generation. Args: prompt (`str` or `List[st | STRING |
| HIGH | examples/qalora_finetuning/qalora_gptq_finetuning.py | 109 | Tokenize text data and prepare it for language modeling. Args: examples: Dataset examples with 'text' | STRING |
| HIGH | src/peft/peft_model.py | 3213 | Get the status of each adapter layer in the model. This function returns a list of `TunerLayerStatus` dataclass ins | STRING |
| HIGH | src/peft/peft_model.py | 3347 | Get the status of tuners of the model. This function returns a `TunerModelStatus` dataclass instance, which contain | STRING |
| HIGH | src/peft/tuners/tuners_utils.py | 364 | A private method to prepare the adapter config. For transformers based models, if `peft_config.target_ | STRING |
| HIGH | src/peft/tuners/tuners_utils.py | 1806 | Find the minimal set of target modules that is sufficient to separate them from the other modules. Sometimes, a ver | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test_adamss_asa.py | 107 | # Step 1: train so B becomes non-zero | COMMENT |
| LOW⚡ | tests/test_adamss_asa.py | 113 | # Step 2: now gradients for A should be non-zero | COMMENT |
| LOW⚡ | tests/test_adamss_asa.py | 123 | # Step 3: another update should change scores via EMA | COMMENT |
| LOW⚡ | tests/test_adamss_asa.py | 166 | # Step 0: train to make B non-zero | COMMENT |
| LOW | examples/lora_ga_finetuning/README.md | 38 | # Step 1: Create LoRA-GA config | COMMENT |
| LOW⚡ | examples/lora_ga_finetuning/README.md | 54 | # Step 2: Preprocess with LoRA-GA to estimate gradients | COMMENT |
| LOW⚡ | examples/lora_ga_finetuning/README.md | 57 | # Step 3: Create PEFT model with LoRA-GA initialization | COMMENT |
| LOW⚡ | examples/lora_ga_finetuning/README.md | 60 | # Step 4: Train normally | COMMENT |
| LOW⚡ | examples/lora_ga_finetuning/README.md | 68 | # Step 5: Save the trained adapter | COMMENT |
| LOW | examples/lora_ga_finetuning/README.md | 211 | ### Step 1: Estimate gradients with full-precision model | COMMENT |
| LOW | examples/lora_ga_finetuning/README.md | 250 | ### Step 2: Load quantized model and apply LoRA-GA | COMMENT |
| LOW⚡ | src/peft/tuners/adamss/model.py | 193 | # Step 1: accumulate importance EVERY step during warmup | COMMENT |
| LOW⚡ | src/peft/tuners/adamss/model.py | 198 | # Step 2: at mask intervals → schedule, global mask, then reset | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test_adamss_asa.py | 107 | # Step 1: train so B becomes non-zero | COMMENT |
| LOW⚡ | tests/test_adamss_asa.py | 113 | # Step 2: now gradients for A should be non-zero | COMMENT |
| LOW⚡ | tests/test_adamss_asa.py | 123 | # Step 3: another update should change scores via EMA | COMMENT |
| LOW⚡ | tests/test_adamss_asa.py | 166 | # Step 0: train to make B non-zero | COMMENT |
| LOW | src/peft/import_utils.py | 96 | # We need to check if `xla_device` can be found, will raise a RuntimeError if not | COMMENT |
| LOW⚡ | src/peft/tuners/adamss/model.py | 193 | # Step 1: accumulate importance EVERY step during warmup | COMMENT |
| LOW⚡ | src/peft/tuners/adamss/model.py | 198 | # Step 2: at mask intervals → schedule, global mask, then reset | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/peft/peft_model.py | 1795 | trainable params: 370178 || all params: 108680450 || trainable%: 0.3406113979101117 | STRING |
| HIGH | src/peft/peft_model.py | 2043 | trainable params: 1843200 || all params: 775873280 || trainable%: 0.23756456724479544 | STRING |
| HIGH | src/peft/peft_model.py | 2384 | trainable params: 884736 || all params: 223843584 || trainable%: 0.3952474242013566 | STRING |
| HIGH | src/peft/peft_model.py | 2653 | trainable params: 370178 || all params: 108680450 || trainable%: 0.3406113979101117 | STRING |
| HIGH | src/peft/peft_model.py | 2883 | trainable params: 592900 || all params: 108312580 || trainable%: 0.5473971721475013 | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/regression/test_regression.py | 189 | model output, and load_base_model(name) to load the base model. Don't forget to fix the seed in load_base_model. | STRING |
| MEDIUM | examples/beft_finetuning/beft_finetuning.py | 68 | # you can try target_modules=["v"], target_modules=["q"], target_modules=["k"] | COMMENT |
| LOW | …ture_extraction/peft_lora_embedding_semantic_search.py | 157 | # make sure to pop weight so that corresponding model is not saved again | COMMENT |
| MEDIUM | examples/arrow_multitask/arrow_phi3_mini.py | 57 | This script is mainly meant for demonstration purposes and lightweight evaluation, | STRING |
| MEDIUM | examples/alora_finetuning/alora_finetuning.py | 168 | Purely for demonstration purposes. See the [paper](https://huggingface.co/papers/2504.12397) | STRING |
| LOW | …s/int8_training/peft_adalora_whisper_large_training.py | 325 | # make sure to pop weight so that corresponding model is not saved again | COMMENT |
| LOW | src/peft/tuners/lora/intruders.py | 115 | # we're not modifying the weights since there are no intruders but we make sure to copy the | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/testing_common.py | 1829 | # TODO: add tests to check if disabling adapters works after calling merge_adapter | STRING |
| LOW | src/peft/tuners/xlora/layer.py | 114 | # TODO: implement X-LoRA with Lora+Dora layers | COMMENT |
| LOW | src/peft/tuners/xlora/layer.py | 165 | # TODO: implement X-LoRA with Lora+Dora layers | COMMENT |
| LOW | src/peft/tuners/xlora/layer.py | 219 | # TODO: implement X-LoRA with Lora+Dora layers | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/source/package_reference/lora.md | 742 | invocation_string = "placeholder" | CODE |