🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.
This report summarizes scanner evidence for huggingface/peft, a Python project with 21,779 GitHub stars. SynthScan examined 224,839 lines of code across 947 source files, recording 3453 pattern matches distributed across 21 syntactic categories. The legacy adjusted pattern signal is 17.9 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 2453 finding(s).
Are imports declared and package/API names verified? 669 finding(s).
Are wrappers, guards, and repeated structures necessary? 2004 finding(s).
Which changes need focused human review? 3453 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 3453 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_loha.py | 27 | def test_hada_weight_gradcheck(self): | CODE |
| LOW | tests/test_loha.py | 36 | def test_hada_weight_cp_gradcheck(self, kernel_size): | CODE |
| 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 | 655 | def test_delete_merged_adapter_is_atomic(self): | CODE |
| LOW | tests/test_mixed.py | 682 | def test_delete_active_adapter_keeps_remaining_adapter_active(self): | CODE |
| LOW | tests/test_mixed.py | 699 | def test_delete_multiple_adapters_removes_every_auxiliary_adapter(self, auxiliary_type): | CODE |
| LOW | tests/test_mixed.py | 737 | def test_unload_modules_to_save_when_active_adapter_does_not_use_it(self): | CODE |
| LOW | tests/test_mixed.py | 772 | def test_get_nb_trainable_parameters(self): | CODE |
| LOW | tests/test_mixed.py | 801 | def test_bias_only_honored_for_non_lora_tuner(self): | CODE |
| LOW | tests/test_mixed.py | 812 | def test_incompatible_config_raises(self): | CODE |
| LOW | tests/test_seq_classifier.py | 364 | def prepare_inputs_for_testing(self): | STRING |
| LOW | tests/test_seq_classifier.py | 371 | def test_attributes_parametrized(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 384 | def test_add_adapter_no_autocast_adapter_dtype(self, model_id, config_cls, config_kwargs, dtype): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 390 | def test_prepare_for_training_parametrized(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 396 | def test_prompt_tuning_text_prepare_for_training(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 414 | def test_save_pretrained_pickle(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 421 | def test_save_pretrained_selected_adapters(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 428 | def test_save_pretrained_selected_adapters_pickle(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 437 | def test_from_pretrained_config_construction(self, model_id, config_cls, config_kwargs): | STRING |
| LOW⚡ | tests/test_seq_classifier.py | 443 | def test_modules_to_save_correctly_set(self, model_id, config_cls, config_kwargs): | STRING |
| LOW | tests/test_seq_classifier.py | 522 | def test_prompt_learning_forward_with_inputs_embeds(self, config_cls, config_kwargs): | STRING |
| LOW | tests/test_seq_classifier.py | 541 | def test_prefix_tuning_legacy_forward_loss_branches(self, problem_type): | STRING |
| LOW | tests/test_seq_classifier.py | 578 | def test_prompt_learning_with_token_type_ids(self): | STRING |
| LOW | tests/test_lora_conversion.py | 79 | def test_no_peft_layer_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 86 | def test_prompt_learning_model_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 97 | def test_peft_model_but_no_support_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 107 | def test_model_with_unsupported_layers_raises(self): | CODE |
| LOW | tests/test_lora_conversion.py | 123 | def test_targeted_modules_identical(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 139 | def test_targeted_modules_identical_target_modules_str(self): | CODE |
| LOW | tests/test_lora_conversion.py | 158 | def test_fixed_rank_lora_config(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 168 | def test_dynamic_rank_lora_config(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 194 | def test_threshold_wrong_value_raises(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 204 | def test_rank_higher_than_weight_dim_raises(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 215 | def test_converting_transformers_model_works(self, lokr_model, tmp_path): | CODE |
| LOW | tests/test_lora_conversion.py | 246 | def test_converted_lora_approximates_original_adapter(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 335 | def test_model_without_peft_config(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 373 | def test_converted_lora_to_lora_works_and_warns(self): | CODE |
| LOW | tests/test_lora_conversion.py | 411 | def test_converted_lora_with_multiple_adapters(self, lokr_model): | CODE |
| LOW | tests/test_lora_conversion.py | 457 | def test_convert_model_with_modules_to_save(self): | CODE |
| LOW | tests/test_lora_conversion.py | 497 | def test_convert_model_with_auxiliary_training_wrappers(self, auxiliary_type): | CODE |
| LOW | tests/test_lora_conversion.py | 563 | def test_convert_model_with_trainable_bias_raises(self, bias): | CODE |
| LOW | tests/test_lora_conversion.py | 672 | def test_miss_supports_lora_conversion(self, miss_model_standard, miss_model_mini, miss_model_bat): | CODE |
| LOW | tests/test_lora_conversion.py | 677 | def test_miss_standard_exact_conversion(self, miss_model_standard): | CODE |
| LOW | tests/test_lora_conversion.py | 694 | def test_miss_mini_exact_conversion(self, miss_model_mini): | CODE |
| LOW | tests/test_lora_conversion.py | 711 | def test_miss_bat_approximate_conversion(self, miss_model_bat): | CODE |
| LOW | tests/test_lora_conversion.py | 733 | def test_miss_targeted_modules_identical(self, miss_model_standard): | CODE |
| LOW | tests/test_lora_conversion.py | 776 | def test_kasa_does_not_support_lora_conversion(self): | CODE |
| LOW⚡ | tests/test_tuners_utils.py | 482 | def test_one_targeted_module_regex(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 487 | def test_two_targeted_module_regex(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 492 | def test_one_targeted_module_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 497 | def test_two_targeted_module_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 600 | def test_two_excluded_module_regex(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 605 | def test_two_excluded_module_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 610 | def test_multiple_excluded_modules_list(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 645 | def test_no_modules_matched_second_adapter(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 655 | def test_second_adapter_only_modules_to_save_raises(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 664 | def test_no_matching_peft_module_error_hierarchy(self): | STRING |
| LOW⚡ | tests/test_tuners_utils.py | 669 | def test_targeted_module_names_unique_across_adapters(self): | STRING |
| 1552 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 | examples/astra_finetuning/astra_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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | 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 operati | STRING |
| 56 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | tests/test_mixed.py | 752 | lin1_weight_before = peft_model.base_model.model.lin1.original_module.weight.data.clone() | CODE |
| CRITICAL | tests/test_lora_conversion.py | 469 | 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 | 470 | 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 | 264 | initial_delta = model.model.model.embed_tokens.trainable_tokens_delta.default.clone() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 265 | initial_originals = model.model.model.embed_tokens.trainable_tokens_original.default.clone() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 816 | assert merged_model.model.decoder.embed_tokens.weight.data_ptr() == merged_model.lm_head.weight.data_ptr() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 853 | assert merged_model.model.decoder.embed_tokens.weight.data_ptr() == merged_model.lm_head.weight.data_ptr() | CODE |
| CRITICAL | tests/test_trainable_tokens.py | 952 | expected_changed_weights = peft_model.model.model.embed_tokens.trainable_tokens_delta.default.data.clone() | CODE |
| CRITICAL | tests/test_gpu_examples.py | 2237 | embed_params = model.base_model.model.model.decoder.embed_tokens.original_module.weight.numel() | STRING |
| CRITICAL⚡ | tests/test_initialization.py | 7052 | model.base_model.model.model.embed_tokens.weight.data_ptr() | CODE |
| CRITICAL⚡ | tests/test_initialization.py | 7053 | != model.base_model.model.lm_head.weight.data_ptr() | CODE |
| CRITICAL | tests/test_initialization.py | 6524 | peft_model.prompt_encoder.default.embedding.weight.data.fill_(1.0) | CODE |
| CRITICAL | tests/test_initialization.py | 6741 | embed_np = dict(model.base_model.model.model.embed_tokens.named_parameters()) | CODE |
| CRITICAL | tests/test_initialization.py | 6801 | embed_np = dict(model.base_model.model.model.embed_tokens.named_parameters()) | CODE |
| CRITICAL | tests/test_initialization.py | 6976 | 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 | 919 | layers[0].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 920 | == layers[1].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 921 | and layers[2].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 922 | == layers[3].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 925 | layers[0].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 926 | != layers[2].mlp.up_proj.base_layer.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 929 | layers[0].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 930 | != layers[1].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 931 | and layers[2].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL⚡ | tests/test_decoder_models.py | 932 | != layers[3].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr() | CODE |
| CRITICAL | tests/test_shira.py | 300 | peft.tuners.shira.layer._warn_once_about_module_hooks.cache_clear() | CODE |
| CRITICAL | tests/test_custom_models.py | 2700 | original_weight = model.base_model.model.conv.base_layer.weight.data.clone() | CODE |
| CRITICAL | tests/test_custom_models.py | 4687 | lm_head_keys = list(model.base_model.model.lm_head.modules_to_save.keys()) | CODE |
| CRITICAL | tests/test_custom_models.py | 4690 | embed_token_keys = list(model.base_model.model.model.decoder.embed_tokens.modules_to_save.keys()) | CODE |
| CRITICAL | src/peft/tuners/tuners_utils.py | 657 | 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 | |
| 560 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 | # 4. Add a tag in git to mark the release: "git tag -a v<VERSION> -m 'Adds tag <VERSION> for pypi' " | COMMENT |
| LOW | tests/test_loha.py | 1 | # Copyright 2026-present the HuggingFace Inc. team. | 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 | 2301 | # Outer( | 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_riemannian_lora.py | 1 | # Copyright 2026-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_shadow.py | 1 | # Copyright 2026-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_frod.py | 1 | # Copyright 2026-present the HuggingFace Inc. team. | COMMENT |
| LOW | tests/test_supertuning.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 | 6301 | # (proj): Conv3d(3, 1280, kernel_size=(2, 14, 14), stride=(2, 14, 14), bias=False) | COMMENT |
| LOW | tests/test_initialization.py | 6321 | # (mlp): Sequential( | COMMENT |
| LOW | tests/test_initialization.py | 6341 | # (up_proj): Linear(in_features=1536, out_features=8960, bias=False) | COMMENT |
| LOW | tests/test_initialization.py | 6381 | return model | COMMENT |
| LOW | tests/test_initialization.py | 6401 | # (mlp): VisionMlp( | COMMENT |
| LOW | tests/test_initialization.py | 6421 | # (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_token_classification_qa.py | 1 | # Copyright 2026-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 |
| 344 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_lora_conversion.py | 643 | CODE | |
| LOW | tests/test_trainable_tokens.py | 722 | CODE | |
| LOW | tests/test_gpu_examples.py | 6782 | CODE | |
| LOW | tests/test_gpu_examples.py | 6838 | CODE | |
| LOW | tests/test_gpu_examples.py | 6902 | CODE | |
| LOW | tests/test_gpu_examples.py | 6065 | CODE | |
| LOW | tests/testing_utils.py | 322 | CODE | |
| LOW | tests/test_adaption_prompt.py | 327 | CODE | |
| LOW | tests/test_adaption_prompt.py | 399 | CODE | |
| LOW | tests/test_adaption_prompt.py | 426 | CODE | |
| LOW | tests/test_initialization.py | 1550 | CODE | |
| LOW | tests/test_initialization.py | 5725 | CODE | |
| LOW | tests/test_initialization.py | 5902 | CODE | |
| LOW | tests/test_initialization.py | 5934 | CODE | |
| LOW | tests/test_decoder_models.py | 487 | CODE | |
| LOW | tests/testing_common.py | 680 | CODE | |
| LOW | tests/testing_common.py | 875 | CODE | |
| LOW | tests/testing_common.py | 1147 | CODE | |
| LOW | tests/testing_common.py | 1319 | CODE | |
| LOW | tests/testing_common.py | 1435 | CODE | |
| LOW | tests/testing_common.py | 1467 | CODE | |
| LOW | tests/testing_common.py | 1526 | CODE | |
| LOW | tests/testing_common.py | 1634 | CODE | |
| LOW | tests/test_other.py | 837 | CODE | |
| LOW | tests/test_arrow.py | 474 | CODE | |
| LOW | tests/test_custom_models.py | 2613 | CODE | |
| LOW | tests/test_custom_models.py | 3110 | CODE | |
| LOW | tests/test_custom_models.py | 3229 | CODE | |
| LOW | method_comparison/app_embed.py | 38 | CODE | |
| LOW | method_comparison/sanitizer.py | 8 | CODE | |
| LOW | method_comparison/app.py | 280 | CODE | |
| LOW | method_comparison/image-gen/run.py | 187 | CODE | |
| LOW | method_comparison/image-gen/utils.py | 322 | 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 | 218 | CODE | |
| LOW | method_comparison/MetaMathQA/utils.py | 369 | 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 | |
| 204 more matches not shown… | ||||
| 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 | scripts/check_doc_coverage.py | 74 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 76 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 91 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 93 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 177 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 179 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 196 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 198 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 257 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 259 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 353 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 355 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 410 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 412 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 453 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 455 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 524 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/check_doc_coverage.py | 526 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/peft/tuners/lora/layer.py | 976 | # ------------------------------------------------------------------------------------------ | COMMENT |
| MEDIUM | src/peft/tuners/lora/layer.py | 979 | # ------------------------------------------------------------------------------------------ | COMMENT |
| 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 | 184 | __all__ = [ | CODE |
| LOW | src/peft/peft_model.py | 1705 | def set_adapter(self, adapter_name: str, inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/peft_model.py | 1731 | 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 | 254 | def set_modules_to_save(self, peft_config: PeftConfig, adapter_name: str) -> None: | CODE |
| LOW | src/peft/mixed_model.py | 269 | def set_adapter(self, adapter_name: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/helpers.py | 33 | def update_forward_signature(model: PeftModel) -> None: | CODE |
| LOW | src/peft/helpers.py | 67 | def update_generate_signature(model: PeftModel) -> None: | CODE |
| LOW | src/peft/helpers.py | 108 | def update_signature(model: PeftModel, method: str = "all") -> None: | CODE |
| LOW | src/peft/utils/hotswap.py | 41 | def _update_scaling(lora_module: LoraLayer, adapter_name: str, scaling: float) -> None: | CODE |
| LOW | src/peft/utils/__init__.py | 93 | __all__ = [ | CODE |
| LOW | src/peft/utils/other.py | 97 | __all__ = [ | CODE |
| LOW | src/peft/utils/other.py | 532 | def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 558 | def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | CODE |
| LOW | src/peft/utils/other.py | 711 | def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 995 | def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 1175 | def _set_adapter(model, adapter_name: str | list[str], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/utils/other.py | 284 | def _set_layer_requires_grad(layer, requires_grad: bool) -> None: | STRING |
| LOW | src/peft/utils/quantization_utils.py | 76 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 117 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 138 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 160 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 192 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/utils/quantization_utils.py | 234 | def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None: | CODE |
| LOW | src/peft/tuners/__init__.py | 81 | __all__ = [ | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 1358 | def set_adapter(self, adapter_name: str | list[str], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 2052 | def set_adapter(self, adapter_names: str | list[str], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 2132 | def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 2773 | def set_requires_grad(model, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | CODE |
| LOW | src/peft/tuners/tuners_utils.py | 591 | def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None: | STRING |
| LOW | src/peft/tuners/tuners_utils.py | 1902 | 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 | 307 | 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 | 206 | def set_adapter(self, adapter_name: Union[str, list[str]], inference_mode: bool = False) -> None: | CODE |
| LOW | src/peft/tuners/shadow/__init__.py | 22 | __all__ = ["DetachedShadowModel", "ShadowCache", "ShadowCarrier", "ShadowConfig", "ShadowLayer", "ShadowModel"] | CODE |
| LOW | src/peft/tuners/shadow/model.py | 172 | def _set_config_attr(config: Any, names: tuple[str, ...], value: int) -> None: | CODE |
| LOW | src/peft/tuners/shadow/model.py | 817 | def set_adapter(self, adapter_name: str | list[str], inference_mode: bool = False) -> None: | CODE |
| 39 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/testing_common.py | 288 | except PermissionError: | CODE |
| HIGH | tests/testing_common.py | 756 | except PermissionError: | CODE |
| HIGH | tests/test_custom_models.py | 3564 | except AssertionError: | CODE |
| HIGH | tests/test_custom_models.py | 4812 | except PermissionError: | CODE |
| HIGH | tests/test_custom_models.py | 4986 | except PermissionError: | CODE |
| HIGH | tests/test_custom_models.py | 2634 | except (AttributeError, TypeError, ValueError): | CODE |
| HIGH | src/peft/peft_model.py | 693 | except AttributeError: | CODE |
| HIGH | src/peft/utils/other.py | 1543 | except (HFValidationError, EntryNotFoundError): | CODE |
| HIGH | src/peft/utils/other.py | 401 | except AttributeError: | CODE |
| HIGH | src/peft/utils/quantization_utils.py | 372 | except AttributeError: | CODE |
| HIGH | src/peft/tuners/tuners_utils.py | 737 | except (NotImplementedError, AttributeError): | CODE |
| HIGH | src/peft/tuners/hira/model.py | 150 | except AttributeError: | CODE |
| HIGH | src/peft/tuners/frod/model.py | 67 | except (ValueError, IndexError): | CODE |
| HIGH | src/peft/tuners/road/model.py | 65 | except AttributeError: | CODE |
| HIGH | src/peft/tuners/lora/arrow.py | 338 | except ImportError: | CODE |
| HIGH | src/peft/tuners/lora/arrow.py | 344 | except ImportError: | CODE |
| HIGH | src/peft/tuners/lora/model.py | 341 | except AttributeError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_trainable_tokens.py | 1341 | # 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 | 5400 | # 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 | 1737 | # 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 | 2308 | # 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/adaption_prompt/model.py | 229 | # The following classmethods mirror the state dict serialization hooks of BaseTuner, which AdaptionPromptModel | 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 | 371 | """This method is not supported for AdaLoRA, use LoRA instead.""" | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/testing_utils.py | 374 | except Exception: | CODE |
| MEDIUM | tests/test_initialization.py | 327 | def test_lora_init_orthogonal_half_precision_dtype(self, dtype): | CODE |
| LOW | tests/test_initialization.py | 330 | except Exception: | CODE |
| LOW | tests/test_arrow.py | 336 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 2887 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 2927 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 2966 | except Exception: | CODE |
| LOW | tests/test_custom_models.py | 3005 | except Exception: | CODE |
| LOW | tests/regression/test_state_dict.py | 621 | 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 | 567 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/run.py | 697 | 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 | 318 | 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/utils.py | 358 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/evaluate.py | 139 | except Exception as exc: | CODE |
| LOW | method_comparison/image-gen/evaluate.py | 261 | 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 | 400 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 365 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 381 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 389 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 518 | except Exception as exc: | CODE |
| LOW | method_comparison/MetaMathQA/utils.py | 526 | 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 |
| MEDIUM | scripts/check_doc_coverage.py | 564 | print(f"Error: source path not found: {args.src}", file=sys.stderr) | CODE |
| MEDIUM | scripts/check_doc_coverage.py | 567 | print(f"Error: docs path not found: {args.docs}", file=sys.stderr) | CODE |
| LOW | scripts/check_doc_coverage.py | 271 | except Exception as exc: | 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 | 262 | except Exception as exc: | STRING |
| LOW | src/peft/config.py | 331 | except Exception: | STRING |
| MEDIUM | src/peft/peft_model.py | 222 | def active_adapters(self) -> list[str]: | CODE |
| LOW | src/peft/peft_model.py | 1180 | except Exception: # something went wrong, roll back | CODE |
| LOW | src/peft/peft_model.py | 2366 | except Exception: | CODE |
| LOW | src/peft/peft_model.py | 2721 | except Exception: | CODE |
| LOW | src/peft/mixed_model.py | 245 | except Exception: # something went wrong, roll back | CODE |
| LOW | src/peft/helpers.py | 157 | except Exception: | CODE |
| 4 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/testing_utils.py | 287 | CODE | |
| LOW | tests/test_lora_variants.py | 75 | 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 | examples/astra_finetuning/datautils.py | 95 | CODE | |
| LOW | scripts/train_memory.py | 106 | CODE | |
| LOW | src/peft/peft_model.py | 2024 | CODE | |
| LOW | src/peft/peft_model.py | 2206 | CODE | |
| LOW | src/peft/peft_model.py | 2546 | CODE | |
| LOW | src/peft/peft_model.py | 2860 | CODE | |
| LOW | src/peft/peft_model.py | 3089 | CODE | |
| LOW | src/peft/peft_model.py | 3160 | CODE | |
| LOW | src/peft/utils/incremental_pca.py | 46 | CODE | |
| LOW | src/peft/utils/healthcheck.py | 261 | CODE | |
| LOW | src/peft/utils/healthcheck.py | 351 | CODE | |
| LOW | src/peft/tuners/hra/layer.py | 297 | CODE | |
| LOW | src/peft/tuners/hra/layer.py | 476 | CODE | |
| LOW | src/peft/tuners/loha/layer.py | 245 | CODE | |
| LOW | src/peft/tuners/lokr/layer.py | 313 | 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 | 1001 | 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 | 253 | CODE | |
| LOW | src/peft/tuners/tinylora/layer.py | 417 | CODE | |
| LOW | src/peft/tuners/miss/layer.py | 380 | CODE | |
| LOW | src/peft/tuners/ia3/layer.py | 353 | CODE | |
| LOW | src/peft/tuners/xlora/layer.py | 139 | CODE | |
| LOW | src/peft/tuners/xlora/layer.py | 250 | CODE | |
| LOW | src/peft/tuners/pvera/layer.py | 320 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 255 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 363 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 465 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 920 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 1249 | CODE | |
| LOW | src/peft/tuners/lora/variants.py | 1567 | CODE | |
| LOW | src/peft/tuners/lora/eva.py | 655 | CODE | |
| LOW | src/peft/tuners/lora/layer.py | 853 | CODE | |
| LOW | src/peft/tuners/lora/layer.py | 2315 | CODE | |
| LOW | src/peft/tuners/randlora/layer.py | 346 | CODE | |
| LOW | src/peft/tuners/oft/layer.py | 659 | CODE | |
| LOW | src/peft/tuners/oft/layer.py | 917 | CODE | |
| LOW | src/peft/tuners/deft/layer.py | 353 | CODE | |
| 1 more matches not shown… | ||||
| 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 | 303 | # Check if lora_A weights have not changed | COMMENT |
| LOW⚡ | tests/test_lorafa.py | 308 | # Check if lora_B weights are non-zero | COMMENT |
| LOW⚡ | tests/test_lorafa.py | 334 | # Check if lora_A weights have not changed | COMMENT |
| LOW⚡ | tests/test_lorafa.py | 339 | # Check if lora_B weights are non-zero and if they follow the expected relation | COMMENT |
| LOW | tests/test_lorafa.py | 371 | # Check if all non-LoRA params also follow the expected relation | COMMENT |
| LOW⚡ | tests/test_config.py | 461 | # Check if the user supplied timing values that will certainly fail because it breaks | STRING |
| LOW | method_comparison/MetaMathQA/utils.py | 450 | # 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 | 1644 | # Check if this is the embedding layer (use endswith to allow flexible matching) | COMMENT |
| LOW⚡ | src/peft/utils/other.py | 1649 | # Check if this target layer matches any tied module (considering nested structures) | COMMENT |
| LOW⚡ | src/peft/utils/other.py | 1657 | # Check if all tied layers have the same indices | COMMENT |
| LOW | src/peft/tuners/tuners_utils.py | 2325 | # 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 | 176 | 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 | 297 | 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 | 520 | 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 | 678 | 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 | 800 | # 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 | 837 | # 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 | 898 | # 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 | 5938 | # increase the scale of the LoRA weights so that the difference between adapters is more pronounced, making | COMMENT |
| MEDIUM⚡ | tests/test_initialization.py | 1619 | # some arguments don't work in conjunction with lora_bias and should raise | COMMENT |
| LOW | tests/test_decoder_models.py | 574 | # a malicious prompt tuning model. This is because PEFT would just pass the on the tokenizer_kwargs defined in | COMMENT |
| MEDIUM | tests/test_multitask_prompt_tuning.py | 326 | # PEFT forward and is thus robust to changes in transformers' generate. | COMMENT |
| LOW | tests/test_other.py | 466 | # aware that some of the passing tests may just pass owing to randomness. | COMMENT |
| MEDIUM | tests/test_custom_models.py | 8304 | # robust and minimal FSDP setup | 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 | 1058 | # TODO: consider replacing this patching of methods with a more robust mechanism: setting a flag and | COMMENT |
| LOW | src/peft/utils/other.py | 1850 | # 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 | 940 | # TODO: check if this the most robust way | STRING |
| LOW | src/peft/tuners/tuners_utils.py | 327 | # model, just add a `peft_config` dict attribute to your model. | STRING |
| MEDIUM | src/peft/tuners/hra/layer.py | 165 | # If we just compute I - V V^T to facilitate parallel computation, we will not get these | COMMENT |
| LOW | src/peft/tuners/adamss/layer.py | 392 | # so just call base_layer directly (no adapter delta needed). | COMMENT |
| LOW | src/peft/tuners/lora/conversion.py | 338 | # effective rank is the same and target_modules are a set, just add the name | COMMENT |
| MEDIUM | src/peft/tuners/lora/layer.py | 394 | # 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 | 3348 | 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 | 3482 | 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 | 390 | A private method to prepare the adapter config. For transformers based models, if `peft_config.target_ | STRING |
| HIGH | src/peft/tuners/tuners_utils.py | 2256 | 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 |
|---|---|---|---|---|
| HIGH | method_comparison/MetaMathQA/run_with_jobs.py | 87 | + "pip uninstall mslk torchao -y -q 2>/dev/null; " # TODO remove once this issue is resolved | CODE |
| HIGH | src/peft/peft_model.py | 1953 | trainable params: 370178 || all params: 108680450 || trainable%: 0.3406113979101117 | STRING |
| HIGH | src/peft/peft_model.py | 2196 | trainable params: 1843200 || all params: 775873280 || trainable%: 0.23756456724479544 | STRING |
| HIGH | src/peft/peft_model.py | 2536 | trainable params: 884736 || all params: 223843584 || trainable%: 0.3952474242013566 | STRING |
| HIGH | src/peft/peft_model.py | 2792 | trainable params: 370178 || all params: 108680450 || trainable%: 0.3406113979101117 | STRING |
| HIGH | src/peft/peft_model.py | 3019 | trainable params: 592900 || all params: 108312580 || trainable%: 0.5473971721475013 | 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 | src/peft/import_utils.py | 113 | # 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 |
|---|---|---|---|---|
| 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/test_config.py | 716 | self, tmp_path, attribute_name, nested_config_cls, dummy_field, dummy_value | CODE |
| LOW⚡ | tests/test_config.py | 719 | setattr(config, attribute_name, nested_config_cls(**{dummy_field: dummy_value})) | CODE |
| LOW⚡ | tests/test_config.py | 726 | assert getattr(nested, dummy_field) == dummy_value | CODE |
| LOW | tests/test_config.py | 703 | "attribute_name, nested_config_cls, dummy_field, dummy_value", | CODE |
| LOW | docs/source/package_reference/lora.md | 814 | invocation_string = "placeholder" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/testing_common.py | 1955 | # TODO: add tests to check if disabling adapters works after calling merge_adapter | STRING |
| LOW | src/peft/peft_model.py | 3623 | # TODO: consider adding info about tied modules (_get_module_names_tied_with_embedding) and DTensors here | COMMENT |
| LOW | src/peft/tuners/xlora/layer.py | 122 | # TODO: implement X-LoRA with Lora+Dora layers | COMMENT |
| LOW | src/peft/tuners/xlora/layer.py | 176 | # TODO: implement X-LoRA with Lora+Dora layers | COMMENT |
| LOW | src/peft/tuners/xlora/layer.py | 233 | # TODO: implement X-LoRA with Lora+Dora layers | COMMENT |