AI Slop Code RIsk Monitor

huggingface/peft

🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.

17.9 Elevated pattern signal View on GitHub

Maintenance and Governance Review

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.

17.9
Adjusted Signal
17.9
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
21.8K
Stars
Python
Language
224.8K
Lines of Code
947
Files
3.5K
Pattern Hits
2026-10-12
Scan Date
0.19
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 38.0/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 2453 finding(s).

Hallucinated Dependency & Supply Chain Risk 18.9/100 · LOW

Are imports declared and package/API names verified? 669 finding(s).

Agent Over-Engineering Ratio 38.7/100 · MEDIUM

Are wrappers, guards, and repeated structures necessary? 2004 finding(s).

PR Review Velocity Impact 64.7/100 · HIGH

Which changes need focused human review? 3453 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 38HIGH 145MEDIUM 81LOW 3189

Directory Score Breakdown

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.

Pattern Findings

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.

Hyper-Verbose Identifiers1612 hits · 1207 pts
SeverityFileLineSnippetContext
LOWtests/test_loha.py27 def test_hada_weight_gradcheck(self):CODE
LOWtests/test_loha.py36 def test_hada_weight_cp_gradcheck(self, kernel_size):CODE
LOWtests/test_mixed.py449 def test_target_different_layers(self, config0, config1):CODE
LOWtests/test_mixed.py490 def test_target_last_layer_same_type(self, config0, config1):CODE
LOWtests/test_mixed.py519 def test_target_first_layer_same_type(self, config0, config1):CODE
LOWtests/test_mixed.py655 def test_delete_merged_adapter_is_atomic(self):CODE
LOWtests/test_mixed.py682 def test_delete_active_adapter_keeps_remaining_adapter_active(self):CODE
LOWtests/test_mixed.py699 def test_delete_multiple_adapters_removes_every_auxiliary_adapter(self, auxiliary_type):CODE
LOWtests/test_mixed.py737 def test_unload_modules_to_save_when_active_adapter_does_not_use_it(self):CODE
LOWtests/test_mixed.py772 def test_get_nb_trainable_parameters(self):CODE
LOWtests/test_mixed.py801 def test_bias_only_honored_for_non_lora_tuner(self):CODE
LOWtests/test_mixed.py812 def test_incompatible_config_raises(self):CODE
LOWtests/test_seq_classifier.py364 def prepare_inputs_for_testing(self):STRING
LOWtests/test_seq_classifier.py371 def test_attributes_parametrized(self, model_id, config_cls, config_kwargs):STRING
LOW⚡tests/test_seq_classifier.py384 def test_add_adapter_no_autocast_adapter_dtype(self, model_id, config_cls, config_kwargs, dtype):STRING
LOW⚡tests/test_seq_classifier.py390 def test_prepare_for_training_parametrized(self, model_id, config_cls, config_kwargs):STRING
LOW⚡tests/test_seq_classifier.py396 def test_prompt_tuning_text_prepare_for_training(self, model_id, config_cls, config_kwargs):STRING
LOW⚡tests/test_seq_classifier.py414 def test_save_pretrained_pickle(self, model_id, config_cls, config_kwargs):STRING
LOW⚡tests/test_seq_classifier.py421 def test_save_pretrained_selected_adapters(self, model_id, config_cls, config_kwargs):STRING
LOW⚡tests/test_seq_classifier.py428 def test_save_pretrained_selected_adapters_pickle(self, model_id, config_cls, config_kwargs):STRING
LOW⚡tests/test_seq_classifier.py437 def test_from_pretrained_config_construction(self, model_id, config_cls, config_kwargs):STRING
LOW⚡tests/test_seq_classifier.py443 def test_modules_to_save_correctly_set(self, model_id, config_cls, config_kwargs):STRING
LOWtests/test_seq_classifier.py522 def test_prompt_learning_forward_with_inputs_embeds(self, config_cls, config_kwargs):STRING
LOWtests/test_seq_classifier.py541 def test_prefix_tuning_legacy_forward_loss_branches(self, problem_type):STRING
LOWtests/test_seq_classifier.py578 def test_prompt_learning_with_token_type_ids(self):STRING
LOWtests/test_lora_conversion.py79 def test_no_peft_layer_raises(self):CODE
LOWtests/test_lora_conversion.py86 def test_prompt_learning_model_raises(self):CODE
LOWtests/test_lora_conversion.py97 def test_peft_model_but_no_support_raises(self):CODE
LOWtests/test_lora_conversion.py107 def test_model_with_unsupported_layers_raises(self):CODE
LOWtests/test_lora_conversion.py123 def test_targeted_modules_identical(self, lokr_model):CODE
LOWtests/test_lora_conversion.py139 def test_targeted_modules_identical_target_modules_str(self):CODE
LOWtests/test_lora_conversion.py158 def test_fixed_rank_lora_config(self, lokr_model):CODE
LOWtests/test_lora_conversion.py168 def test_dynamic_rank_lora_config(self, lokr_model):CODE
LOWtests/test_lora_conversion.py194 def test_threshold_wrong_value_raises(self, lokr_model):CODE
LOWtests/test_lora_conversion.py204 def test_rank_higher_than_weight_dim_raises(self, lokr_model):CODE
LOWtests/test_lora_conversion.py215 def test_converting_transformers_model_works(self, lokr_model, tmp_path):CODE
LOWtests/test_lora_conversion.py246 def test_converted_lora_approximates_original_adapter(self, lokr_model):CODE
LOWtests/test_lora_conversion.py335 def test_model_without_peft_config(self, lokr_model):CODE
LOWtests/test_lora_conversion.py373 def test_converted_lora_to_lora_works_and_warns(self):CODE
LOWtests/test_lora_conversion.py411 def test_converted_lora_with_multiple_adapters(self, lokr_model):CODE
LOWtests/test_lora_conversion.py457 def test_convert_model_with_modules_to_save(self):CODE
LOWtests/test_lora_conversion.py497 def test_convert_model_with_auxiliary_training_wrappers(self, auxiliary_type):CODE
LOWtests/test_lora_conversion.py563 def test_convert_model_with_trainable_bias_raises(self, bias):CODE
LOWtests/test_lora_conversion.py672 def test_miss_supports_lora_conversion(self, miss_model_standard, miss_model_mini, miss_model_bat):CODE
LOWtests/test_lora_conversion.py677 def test_miss_standard_exact_conversion(self, miss_model_standard):CODE
LOWtests/test_lora_conversion.py694 def test_miss_mini_exact_conversion(self, miss_model_mini):CODE
LOWtests/test_lora_conversion.py711 def test_miss_bat_approximate_conversion(self, miss_model_bat):CODE
LOWtests/test_lora_conversion.py733 def test_miss_targeted_modules_identical(self, miss_model_standard):CODE
LOWtests/test_lora_conversion.py776 def test_kasa_does_not_support_lora_conversion(self):CODE
LOW⚡tests/test_tuners_utils.py482 def test_one_targeted_module_regex(self):STRING
LOW⚡tests/test_tuners_utils.py487 def test_two_targeted_module_regex(self):STRING
LOW⚡tests/test_tuners_utils.py492 def test_one_targeted_module_list(self):STRING
LOW⚡tests/test_tuners_utils.py497 def test_two_targeted_module_list(self):STRING
LOW⚡tests/test_tuners_utils.py600 def test_two_excluded_module_regex(self):STRING
LOW⚡tests/test_tuners_utils.py605 def test_two_excluded_module_list(self):STRING
LOW⚡tests/test_tuners_utils.py610 def test_multiple_excluded_modules_list(self):STRING
LOW⚡tests/test_tuners_utils.py645 def test_no_modules_matched_second_adapter(self):STRING
LOW⚡tests/test_tuners_utils.py655 def test_second_adapter_only_modules_to_save_raises(self):STRING
LOW⚡tests/test_tuners_utils.py664 def test_no_matching_peft_module_error_hierarchy(self):STRING
LOW⚡tests/test_tuners_utils.py669 def test_targeted_module_names_unique_across_adapters(self):STRING
1552 more matches not shown…
Cross-File Repetition116 hits · 580 pts
SeverityFileLineSnippetContext
HIGHtests/test_gpu_examples.py0efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109STRING
HIGHtests/test_vision_models.py0efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109STRING
HIGHtests/test_gptqmodel.py0efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109STRING
HIGHtests/test_common_gpu.py0efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109STRING
HIGHtests/test_torch_compile.py0efficient mechanism to free gpu memory after each test. based on https://github.com/huggingface/transformers/issues/2109STRING
HIGHdocs/source/package_reference/lora.md0run forward and backward passes for gradient estimation.STRING
HIGHexamples/lora_ga_finetuning/README.md0run forward and backward passes for gradient estimation.STRING
HIGHexamples/lora_ga_finetuning/lora_ga_finetuning.py0run forward and backward passes for gradient estimation.STRING
HIGHexamples/boft_controlnet/utils/tracemalloc.py0get resident set size memory for the current processSTRING
HIGH…_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py0get resident set size memory for the current processSTRING
HIGHexamples/deft_dreambooth/train_dreambooth.py0get resident set size memory for the current processSTRING
HIGHexamples/oft_dreambooth/train_dreambooth.py0get resident set size memory for the current processSTRING
HIGHexamples/hra_dreambooth/utils/tracemalloc.py0get resident set size memory for the current processSTRING
HIGHexamples/stable_diffusion/train_dreambooth.py0get resident set size memory for the current processSTRING
HIGHexamples/lora_dreambooth/train_dreambooth.py0get resident set size memory for the current processSTRING
HIGHexamples/boft_dreambooth/utils/tracemalloc.py0get resident set size memory for the current processSTRING
HIGH…ation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py0get resident set size memory for the current processSTRING
HIGHexamples/waveft_finetuning/waveft_finetuning.py0below is an instruction that describes a task. write a response that appropriately completes the request. ### instructioSTRING
HIGHexamples/hira_finetuning/hira_finetuning.py0below is an instruction that describes a task. write a response that appropriately completes the request. ### instructioSTRING
HIGHexamples/glora_finetuning/glora_finetuning.py0below is an instruction that describes a task. write a response that appropriately completes the request. ### instructioSTRING
HIGHexamples/olora_finetuning/olora_finetuning.py0below is an instruction that describes a task. write a response that appropriately completes the request. ### instructioSTRING
HIGHexamples/shira_finetuning/shira_finetuning.py0below is an instruction that describes a task. write a response that appropriately completes the request. ### instructioSTRING
HIGHexamples/deft_dreambooth/train_dreambooth.py0a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imagSTRING
HIGHexamples/oft_dreambooth/train_dreambooth.py0a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imagSTRING
HIGHexamples/hra_dreambooth/utils/dataset.py0a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imagSTRING
HIGHexamples/stable_diffusion/train_dreambooth.py0a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imagSTRING
HIGHexamples/lora_dreambooth/train_dreambooth.py0a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imagSTRING
HIGHexamples/boft_dreambooth/utils/dataset.py0a dataset to prepare the instance and class images with the prompts for fine-tuning the model. it pre-processes the imagSTRING
HIGHexamples/corda_finetuning/corda_finetuning.py0returns the number of trainable parameters and number of all parameters in the model.STRING
HIGHexamples/astra_finetuning/astra_finetuning.py0returns the number of trainable parameters and number of all parameters in the model.STRING
HIGHsrc/peft/peft_model.py0returns the number of trainable parameters and number of all parameters in the model.STRING
HIGHsrc/peft/mixed_model.py0returns the number of trainable parameters and number of all parameters in the model.STRING
HIGHsrc/peft/peft_model.py0deletes an existing adapter. args: adapter_name (str): name of the adapter to be deleted.STRING
HIGHsrc/peft/tuners/tuners_utils.py0deletes an existing adapter. args: adapter_name (str): name of the adapter to be deleted.STRING
HIGHsrc/peft/tuners/waveft/model.py0deletes an existing adapter. args: adapter_name (str): name of the adapter to be deleted.STRING
HIGHsrc/peft/utils/other.py0check if the arguments are compatible with the configs and state of the modelSTRING
HIGHsrc/peft/tuners/road/layer.py0check if the arguments are compatible with the configs and state of the modelSTRING
HIGHsrc/peft/tuners/lora/layer.py0check if the arguments are compatible with the configs and state of the modelSTRING
HIGHsrc/peft/tuners/lycoris_utils.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/hra/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/road/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/miss/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/oft/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/vera/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/delora/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/boft/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/waveft/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/c3a/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/hira/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/hira/bnb.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/road/bnb.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/fourierft/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/vblora/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/gralora/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/ia3/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/adalora/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/pvera/layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/lora/hqq.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/lora/tp_layer.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
HIGHsrc/peft/tuners/lora/inc.py0merge the active adapter weights into the base weights args: safe_merge (`bool`, *optional*): if true, the merge operatiSTRING
56 more matches not shown…
Hallucination Indicators38 hits · 470 pts
SeverityFileLineSnippetContext
CRITICALtests/test_mixed.py752 lin1_weight_before = peft_model.base_model.model.lin1.original_module.weight.data.clone()CODE
CRITICALtests/test_lora_conversion.py469 lokr_model.base_model.model.model.decoder.layers[0].fc1.modules_to_save.default.weight.data.mul_(-10.0)CODE
CRITICALtests/test_lora_conversion.py470 lokr_model.base_model.model.model.decoder.layers[0].fc1.modules_to_save.default.bias.data.mul_(-10.0)CODE
CRITICAL⚡tests/test_cpt.py247 emb = model.prompt_encoder.default.embedding.weight.data.clone().detach()CODE
CRITICAL⚡tests/test_cpt.py263 assert torch.all(model.prompt_encoder.default.embedding.weight.data.clone().detach().cpu() == emb.cpu())CODE
CRITICAL⚡tests/test_cpt.py277 emb = model.prompt_encoder.default.embedding.weight.data.clone().detach()CODE
CRITICALtests/test_cpt.py294 assert torch.all(model.prompt_encoder.default.embedding.weight.data.clone().detach().cpu() == emb.cpu())CODE
CRITICALtests/test_trainable_tokens.py264 initial_delta = model.model.model.embed_tokens.trainable_tokens_delta.default.clone()CODE
CRITICALtests/test_trainable_tokens.py265 initial_originals = model.model.model.embed_tokens.trainable_tokens_original.default.clone()CODE
CRITICALtests/test_trainable_tokens.py816 assert merged_model.model.decoder.embed_tokens.weight.data_ptr() == merged_model.lm_head.weight.data_ptr()CODE
CRITICALtests/test_trainable_tokens.py853 assert merged_model.model.decoder.embed_tokens.weight.data_ptr() == merged_model.lm_head.weight.data_ptr()CODE
CRITICALtests/test_trainable_tokens.py952 expected_changed_weights = peft_model.model.model.embed_tokens.trainable_tokens_delta.default.data.clone()CODE
CRITICALtests/test_gpu_examples.py2237 embed_params = model.base_model.model.model.decoder.embed_tokens.original_module.weight.numel()STRING
CRITICAL⚡tests/test_initialization.py7052 model.base_model.model.model.embed_tokens.weight.data_ptr()CODE
CRITICAL⚡tests/test_initialization.py7053 != model.base_model.model.lm_head.weight.data_ptr()CODE
CRITICALtests/test_initialization.py6524 peft_model.prompt_encoder.default.embedding.weight.data.fill_(1.0)CODE
CRITICALtests/test_initialization.py6741 embed_np = dict(model.base_model.model.model.embed_tokens.named_parameters())CODE
CRITICALtests/test_initialization.py6801 embed_np = dict(model.base_model.model.model.embed_tokens.named_parameters())CODE
CRITICALtests/test_initialization.py6976 shared_np = dict(model.base_model.model.model.shared.named_parameters())CODE
CRITICAL⚡tests/test_target_parameters.py384 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.py385 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.py386 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.py387 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.py919 layers[0].mlp.up_proj.base_layer.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py920 == layers[1].mlp.up_proj.base_layer.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py921 and layers[2].mlp.up_proj.base_layer.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py922 == layers[3].mlp.up_proj.base_layer.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py925 layers[0].mlp.up_proj.base_layer.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py926 != layers[2].mlp.up_proj.base_layer.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py929 layers[0].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py930 != layers[1].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py931 and layers[2].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr()CODE
CRITICAL⚡tests/test_decoder_models.py932 != layers[3].mlp.up_proj.lora_A.default.weight.data.storage().data_ptr()CODE
CRITICALtests/test_shira.py300 peft.tuners.shira.layer._warn_once_about_module_hooks.cache_clear()CODE
CRITICALtests/test_custom_models.py2700 original_weight = model.base_model.model.conv.base_layer.weight.data.clone()CODE
CRITICALtests/test_custom_models.py4687 lm_head_keys = list(model.base_model.model.lm_head.modules_to_save.keys())CODE
CRITICALtests/test_custom_models.py4690 embed_token_keys = list(model.base_model.model.model.decoder.embed_tokens.modules_to_save.keys())CODE
CRITICALsrc/peft/tuners/tuners_utils.py657 model.lm_head.weight.data = model.model.embed_tokens.weight.data.clone()CODE
Unused Imports620 hits · 450 pts
SeverityFileLineSnippetContext
LOWtests/test_lorafa.py15CODE
LOWtests/test_trainable_tokens.py15CODE
LOWtests/test_loraplus.py14CODE
LOWmethod_comparison/app_embed.py26CODE
LOWmethod_comparison/app_embed.py26CODE
LOWexamples/stable_diffusion/inc_flux_lora_hpu.py26CODE
LOWsrc/peft/config.py14CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py17CODE
LOWsrc/peft/__init__.py27CODE
LOWsrc/peft/__init__.py27CODE
LOWsrc/peft/__init__.py28CODE
LOWsrc/peft/__init__.py29CODE
LOWsrc/peft/__init__.py29CODE
LOWsrc/peft/__init__.py29CODE
LOWsrc/peft/__init__.py29CODE
LOWsrc/peft/__init__.py29CODE
LOWsrc/peft/__init__.py36CODE
LOWsrc/peft/__init__.py37CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py38CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
LOWsrc/peft/__init__.py49CODE
560 more matches not shown…
Over-Commented Block404 hits · 392 pts
SeverityFileLineSnippetContext
LOWsetup.py1# Copyright 2023 The HuggingFace Team. All rights reserved.COMMENT
LOWsetup.py101# 4. Add a tag in git to mark the release: "git tag -a v<VERSION> -m 'Adds tag <VERSION> for pypi' "COMMENT
LOWtests/test_loha.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
LOWtests/test_mixed.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_seq_classifier.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_lora_conversion.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_tuners_utils.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_tuners_utils.py2301 # Outer(COMMENT
LOWtests/conftest.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_xlora.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_riemannian_lora.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
LOWtests/test_hub_features.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_lorafa.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_cpt.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_low_level_api.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_lora_megatron.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_trainable_tokens.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_gpu_examples.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_integrations.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_poly.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/testing_utils.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_loraplus.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_adaption_prompt.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_shadow.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
LOWtests/test_frod.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
LOWtests/test_supertuning.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
LOWtests/test_initialization.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_initialization.py6301 # (proj): Conv3d(3, 1280, kernel_size=(2, 14, 14), stride=(2, 14, 14), bias=False)COMMENT
LOWtests/test_initialization.py6321 # (mlp): Sequential(COMMENT
LOWtests/test_initialization.py6341 # (up_proj): Linear(in_features=1536, out_features=8960, bias=False)COMMENT
LOWtests/test_initialization.py6381 return modelCOMMENT
LOWtests/test_initialization.py6401 # (mlp): VisionMlp(COMMENT
LOWtests/test_initialization.py6421 # (self_attn): Qwen2VLAttention(COMMENT
LOWtests/test_target_parameters.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_pvera.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_vision_models.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_gptqmodel.py1# Note: These tests were copied from test_common_gpu.py and test_gpu_examples.py as they can run on CPU too.COMMENT
LOWtests/test_decoder_models.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_encoder_decoder_models.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_multitask_prompt_tuning.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_lora_ga.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/testing_common.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_quantization.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_common_gpu.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_cartridge.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_vblora.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_token_classification_qa.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
LOWtests/test_config.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_randlora.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_unilora.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_shira.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_boft.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_feature_extraction_models.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_bdlora.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
LOWtests/test_helpers.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_stablediffusion.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_lora_variants.py1# Copyright 2025-present the HuggingFace Inc. team.COMMENT
LOWtests/test_incremental_pca.py1# Copyright 2024-present the HuggingFace Inc. team.COMMENT
LOWtests/test_auto.py1# Copyright 2023-present the HuggingFace Inc. team.COMMENT
LOWtests/test_deft.py1# Copyright 2026-present the HuggingFace Inc. team.COMMENT
344 more matches not shown…
Deep Nesting264 hits · 236 pts
SeverityFileLineSnippetContext
LOWtests/test_lora_conversion.py643CODE
LOWtests/test_trainable_tokens.py722CODE
LOWtests/test_gpu_examples.py6782CODE
LOWtests/test_gpu_examples.py6838CODE
LOWtests/test_gpu_examples.py6902CODE
LOWtests/test_gpu_examples.py6065CODE
LOWtests/testing_utils.py322CODE
LOWtests/test_adaption_prompt.py327CODE
LOWtests/test_adaption_prompt.py399CODE
LOWtests/test_adaption_prompt.py426CODE
LOWtests/test_initialization.py1550CODE
LOWtests/test_initialization.py5725CODE
LOWtests/test_initialization.py5902CODE
LOWtests/test_initialization.py5934CODE
LOWtests/test_decoder_models.py487CODE
LOWtests/testing_common.py680CODE
LOWtests/testing_common.py875CODE
LOWtests/testing_common.py1147CODE
LOWtests/testing_common.py1319CODE
LOWtests/testing_common.py1435CODE
LOWtests/testing_common.py1467CODE
LOWtests/testing_common.py1526CODE
LOWtests/testing_common.py1634CODE
LOWtests/test_other.py837CODE
LOWtests/test_arrow.py474CODE
LOWtests/test_custom_models.py2613CODE
LOWtests/test_custom_models.py3110CODE
LOWtests/test_custom_models.py3229CODE
LOWmethod_comparison/app_embed.py38CODE
LOWmethod_comparison/sanitizer.py8CODE
LOWmethod_comparison/app.py280CODE
LOWmethod_comparison/image-gen/run.py187CODE
LOWmethod_comparison/image-gen/utils.py322CODE
LOWmethod_comparison/text_generation_benchmark/run.py139CODE
LOWmethod_comparison/text_generation_benchmark/utils.py205CODE
LOWmethod_comparison/peft-shop/app.py1110CODE
LOWmethod_comparison/MetaMathQA/utils.py218CODE
LOWmethod_comparison/MetaMathQA/utils.py369CODE
LOW…les/sequence_classification/peft_no_lora_accelerate.py79CODE
LOWexamples/boft_controlnet/train_controlnet.py86CODE
LOWexamples/boft_controlnet/utils/pipeline_controlnet.py53CODE
LOWexamples/boft_controlnet/utils/pipeline_controlnet.py166CODE
LOWexamples/boft_controlnet/utils/dataset.py82CODE
LOWexamples/boft_controlnet/utils/dataset.py136CODE
LOW…ture_extraction/peft_lora_embedding_semantic_search.py210CODE
LOW…_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py110CODE
LOWexamples/arrow_multitask/arrow_phi3_mini.py120CODE
LOWexamples/loftq_finetuning/int8_correction.py68CODE
LOWexamples/loftq_finetuning/train_gsm8k_llama.py297CODE
LOW…orthogonal_subspace_learning/osf_continual_learning.py51CODE
LOW…orthogonal_subspace_learning/osf_continual_learning.py99CODE
LOW…orthogonal_subspace_learning/osf_continual_learning.py142CODE
LOWexamples/orthogonal_subspace_learning/utils.py42CODE
LOWexamples/deft_dreambooth/train_dreambooth.py585CODE
LOWexamples/oft_dreambooth/train_dreambooth.py590CODE
LOWexamples/hra_dreambooth/train_dreambooth.py82CODE
LOWexamples/qalora_finetuning/qalora_gptq_finetuning.py23CODE
LOWexamples/stable_diffusion/train_dreambooth.py754CODE
LOWexamples/stable_diffusion/convert_sd_adapter_to_peft.py285CODE
LOWexamples/lora_dreambooth/train_dreambooth.py580CODE
204 more matches not shown…
Decorative Section Separators35 hits · 111 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_arrow.py30# ─── Fixtures ──────────────────────────────────────────────────────────COMMENT
MEDIUMexamples/KappaTune/experiments_kappatune_peft.py19# ==========================================COMMENT
MEDIUMexamples/KappaTune/experiments_kappatune_peft.py21# ==========================================COMMENT
MEDIUMexamples/KappaTune/experiments_kappatune_peft.py47# ==========================================COMMENT
MEDIUMexamples/KappaTune/experiments_kappatune_peft.py49# ==========================================COMMENT
MEDIUMexamples/KappaTune/experiments_kappatune_peft.py146# ==========================================COMMENT
MEDIUMexamples/KappaTune/experiments_kappatune_peft.py148# ==========================================COMMENT
MEDIUM⚡…etuning/sequence_classification_finetune_monteclora.py21# ----------------------------------------------------------------------------COMMENT
MEDIUM⚡…etuning/sequence_classification_finetune_monteclora.py23# ----------------------------------------------------------------------------COMMENT
MEDIUM⚡…etuning/sequence_classification_finetune_monteclora.py29# ----------------------------------------------------------------------------COMMENT
MEDIUM⚡…etuning/sequence_classification_finetune_monteclora.py31# ----------------------------------------------------------------------------COMMENT
MEDIUM…etuning/sequence_classification_finetune_monteclora.py42# ----------------------------------------------------------------------------COMMENT
MEDIUM…etuning/sequence_classification_finetune_monteclora.py44# ----------------------------------------------------------------------------COMMENT
MEDIUM…etuning/sequence_classification_finetune_monteclora.py162# ----------------------------------------------------------------------------COMMENT
MEDIUM…etuning/sequence_classification_finetune_monteclora.py164# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py74# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py76# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py91# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py93# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py177# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py179# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py196# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py198# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py257# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py259# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py353# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py355# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py410# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py412# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py453# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py455# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py524# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/check_doc_coverage.py526# ---------------------------------------------------------------------------COMMENT
MEDIUMsrc/peft/tuners/lora/layer.py976# ------------------------------------------------------------------------------------------COMMENT
MEDIUMsrc/peft/tuners/lora/layer.py979# ------------------------------------------------------------------------------------------COMMENT
Modern Structural Boilerplate99 hits · 96 pts
SeverityFileLineSnippetContext
LOWmethod_comparison/app.py46logger = logging.getLogger(__name__)CODE
LOWmethod_comparison/peft-shop/app.py294def _set_data(data: dict[str, Any]) -> None:CODE
LOWexamples/stable_diffusion/convert_sd_adapter_to_peft.py20logger = logging.getLogger(__name__)CODE
LOWsrc/peft/__init__.py184__all__ = [CODE
LOWsrc/peft/peft_model.py1705 def set_adapter(self, adapter_name: str, inference_mode: bool = False) -> None:CODE
LOWsrc/peft/peft_model.py1731 def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None:CODE
LOWsrc/peft/functional.py26__all__ = [CODE
LOWsrc/peft/mixed_model.py254 def set_modules_to_save(self, peft_config: PeftConfig, adapter_name: str) -> None:CODE
LOWsrc/peft/mixed_model.py269 def set_adapter(self, adapter_name: Union[str, list[str]], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/helpers.py33def update_forward_signature(model: PeftModel) -> None:CODE
LOWsrc/peft/helpers.py67def update_generate_signature(model: PeftModel) -> None:CODE
LOWsrc/peft/helpers.py108def update_signature(model: PeftModel, method: str = "all") -> None:CODE
LOWsrc/peft/utils/hotswap.py41def _update_scaling(lora_module: LoraLayer, adapter_name: str, scaling: float) -> None:CODE
LOWsrc/peft/utils/__init__.py93__all__ = [CODE
LOWsrc/peft/utils/other.py97__all__ = [CODE
LOWsrc/peft/utils/other.py532 def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/utils/other.py558 def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None:CODE
LOWsrc/peft/utils/other.py711 def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/utils/other.py995 def set_adapter(self, adapter_names: Union[str, list[str]], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/utils/other.py1175def _set_adapter(model, adapter_name: str | list[str], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/utils/other.py284def _set_layer_requires_grad(layer, requires_grad: bool) -> None:STRING
LOWsrc/peft/utils/quantization_utils.py76 def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None:CODE
LOWsrc/peft/utils/quantization_utils.py117 def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None:CODE
LOWsrc/peft/utils/quantization_utils.py138 def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None:CODE
LOWsrc/peft/utils/quantization_utils.py160 def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None:CODE
LOWsrc/peft/utils/quantization_utils.py192 def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None:CODE
LOWsrc/peft/utils/quantization_utils.py234 def set_base_weight(self, peft_layer, weight_data: torch.Tensor) -> None:CODE
LOWsrc/peft/tuners/__init__.py81__all__ = [CODE
LOWsrc/peft/tuners/tuners_utils.py1358 def set_adapter(self, adapter_name: str | list[str], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/tuners/tuners_utils.py2052 def set_adapter(self, adapter_names: str | list[str], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/tuners/tuners_utils.py2132 def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None:CODE
LOWsrc/peft/tuners/tuners_utils.py2773def set_requires_grad(model, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None:CODE
LOWsrc/peft/tuners/tuners_utils.py591 def set_requires_grad(self, adapter_names: str | Sequence[str], requires_grad: bool = True) -> None:STRING
LOWsrc/peft/tuners/tuners_utils.py1902 def set_base_weight(self, weight_data: torch.Tensor) -> None:STRING
LOWsrc/peft/tuners/peanut/__init__.py22__all__ = ["Linear", "PeanutConfig", "PeanutLayer", "PeanutModel"]CODE
LOWsrc/peft/tuners/prompt_tuning/__init__.py21__all__ = ["PromptEmbedding", "PromptTuningConfig", "PromptTuningInit"]CODE
LOWsrc/peft/tuners/hra/__init__.py22__all__ = ["HRAConfig", "HRAConv2d", "HRALayer", "HRALinear", "HRAModel"]CODE
LOWsrc/peft/tuners/loha/__init__.py22__all__ = ["Conv2d", "Linear", "LoHaConfig", "LoHaLayer", "LoHaModel"]CODE
LOWsrc/peft/tuners/lokr/__init__.py22__all__ = ["Conv2d", "Linear", "LoKrConfig", "LoKrLayer", "LoKrModel"]CODE
LOWsrc/peft/tuners/vera/__init__.py22__all__ = ["Linear", "VeraConfig", "VeraLayer", "VeraModel"]CODE
LOWsrc/peft/tuners/ln_tuning/__init__.py21__all__ = ["LNTuningConfig", "LNTuningModel"]CODE
LOWsrc/peft/tuners/cpt/__init__.py22__all__ = ["CPTConfig", "CPTEmbedding"]CODE
LOWsrc/peft/tuners/delora/__init__.py21__all__ = ["DeloraConfig", "DeloraLayer", "DeloraLinear", "DeloraModel"]CODE
LOWsrc/peft/tuners/boft/__init__.py22__all__ = ["BOFTConfig", "BOFTLayer", "BOFTModel"]CODE
LOWsrc/peft/tuners/psoft/__init__.py22__all__ = ["Linear", "PsoftConfig", "PsoftLayer", "PsoftModel"]CODE
LOW⚡src/peft/tuners/psoft/layer.py235 def _set_psoft_ab_cache_buffers(self, adapter_name: str, A: torch.Tensor, B: torch.Tensor) -> None:CODE
LOW⚡src/peft/tuners/psoft/layer.py239 def update_layer(self, adapter_name: str, config: PsoftConfig, **kwargs: Any) -> None:CODE
LOWsrc/peft/tuners/beft/__init__.py23__all__ = ["BeftConfig", "BeftLayer", "BeftModel", "Linear"]CODE
LOWsrc/peft/tuners/waveft/__init__.py22__all__ = ["WaveFTConfig", "WaveFTLayer", "WaveFTLinear", "WaveFTModel"]CODE
LOWsrc/peft/tuners/c3a/__init__.py21__all__ = ["C3AConfig", "C3ALayer", "C3ALinear", "C3AModel"]CODE
LOWsrc/peft/tuners/p_tuning/__init__.py21__all__ = ["PromptEncoder", "PromptEncoderConfig", "PromptEncoderReparameterizationType"]CODE
LOWsrc/peft/tuners/adamss/__init__.py22__all__ = [CODE
LOWsrc/peft/tuners/adamss/model.py157 def update_and_allocate(self, global_step: int) -> None:CODE
LOWsrc/peft/tuners/hira/__init__.py23__all__ = [CODE
LOWsrc/peft/tuners/hira/layer.py307 def update_layer(self, adapter_name, r, config: HiraConfig, **kwargs) -> None:CODE
LOWsrc/peft/tuners/mixed/__init__.py18__all__ = ["COMPATIBLE_TUNER_TYPES", "MixedModel"]CODE
LOWsrc/peft/tuners/mixed/model.py206 def set_adapter(self, adapter_name: Union[str, list[str]], inference_mode: bool = False) -> None:CODE
LOWsrc/peft/tuners/shadow/__init__.py22__all__ = ["DetachedShadowModel", "ShadowCache", "ShadowCarrier", "ShadowConfig", "ShadowLayer", "ShadowModel"]CODE
LOWsrc/peft/tuners/shadow/model.py172def _set_config_attr(config: Any, names: tuple[str, ...], value: int) -> None:CODE
LOWsrc/peft/tuners/shadow/model.py817 def set_adapter(self, adapter_name: str | list[str], inference_mode: bool = False) -> None:CODE
39 more matches not shown…
Empty Error Handlers17 hits · 85 pts
SeverityFileLineSnippetContext
HIGHtests/testing_common.py288except PermissionError:CODE
HIGHtests/testing_common.py756except PermissionError:CODE
HIGHtests/test_custom_models.py3564except AssertionError:CODE
HIGHtests/test_custom_models.py4812except PermissionError:CODE
HIGHtests/test_custom_models.py4986except PermissionError:CODE
HIGHtests/test_custom_models.py2634except (AttributeError, TypeError, ValueError):CODE
HIGHsrc/peft/peft_model.py693except AttributeError:CODE
HIGHsrc/peft/utils/other.py1543except (HFValidationError, EntryNotFoundError):CODE
HIGHsrc/peft/utils/other.py401except AttributeError:CODE
HIGHsrc/peft/utils/quantization_utils.py372except AttributeError:CODE
HIGHsrc/peft/tuners/tuners_utils.py737except (NotImplementedError, AttributeError):CODE
HIGHsrc/peft/tuners/hira/model.py150except AttributeError:CODE
HIGHsrc/peft/tuners/frod/model.py67except (ValueError, IndexError):CODE
HIGHsrc/peft/tuners/road/model.py65except AttributeError:CODE
HIGHsrc/peft/tuners/lora/arrow.py338except ImportError:CODE
HIGHsrc/peft/tuners/lora/arrow.py344except ImportError:CODE
HIGHsrc/peft/tuners/lora/model.py341except AttributeError:CODE
Self-Referential Comments27 hits · 79 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_trainable_tokens.py1341 # Create a composite model with two BART sub-modelsCOMMENT
MEDIUMtests/test_lora_ga.py130 # Create a fresh model and load the saved stateCOMMENT
MEDIUMtests/test_helpers.py669 # Create a minimal dummy MoE model with fused 3D weightsCOMMENT
MEDIUMtests/test_custom_models.py5400 # Create a weighted adapter combining both adapters and check that its output is same as setting multipleCOMMENT
MEDIUMmethod_comparison/app_embed.py58 # Create an empty figure.COMMENT
MEDIUMmethod_comparison/app.py57 # Create an empty figure.COMMENT
MEDIUMexamples/boft_controlnet/train_controlnet.py537 # Create the pipeline using using the trained modules and save it.COMMENT
MEDIUMexamples/arrow_multitask/arrow_phi3_mini.py362 # Creating the Arrow modelCOMMENT
MEDIUM…orthogonal_subspace_learning/osf_continual_learning.py57 # Create a simple dataloaderCOMMENT
MEDIUMexamples/deft_dreambooth/train_dreambooth.py1072 # Create the pipeline using using the trained modules and save it.COMMENT
MEDIUMexamples/oft_dreambooth/train_dreambooth.py1079 # Create the pipeline using using the trained modules and save it.COMMENT
MEDIUMexamples/hra_dreambooth/train_dreambooth.sh4# Define the UNIQUE_TOKEN, CLASS_TOKENs, and SUBJECT_NAMESCOMMENT
MEDIUMexamples/stable_diffusion/train_dreambooth.py1239 # Create the pipeline using using the trained modules and save it.COMMENT
MEDIUMexamples/stable_diffusion/convert_sd_adapter_to_peft.py409 # Create a corresponding adapter infoCOMMENT
MEDIUMexamples/lora_dreambooth/train_dreambooth.py1071 # Create the pipeline using using the trained modules and save it.COMMENT
MEDIUMexamples/boft_dreambooth/train_dreambooth.sh5# Define the UNIQUE_TOKEN, CLASS_TOKENs, and SUBJECT_NAMESCOMMENT
MEDIUMexamples/lora_ga_finetuning/lora_ga_finetuning.py167 # Create a simple DataLoader for gradient estimationCOMMENT
MEDIUMsrc/peft/utils/other.py1737 # Create the causal mask with fixed shape in advance, to reduce recompilations. If the function to createCOMMENT
MEDIUMsrc/peft/tuners/tuners_utils.py2308 # Create a reverse lookup for other_module_names to quickly check suffix matchesCOMMENT
MEDIUMsrc/peft/tuners/boft/layer.py178 # Create a mask with 1s for matrices to be replaced with identity and 0s otherwiseCOMMENT
MEDIUMsrc/peft/tuners/waveft/layer.py133 # Create a padded spectrum matrix with additional rows and columnsCOMMENT
MEDIUMsrc/peft/tuners/waveft/layer.py144 # Create the padded dense spectrum matrixCOMMENT
MEDIUMsrc/peft/tuners/waveft/waverec2d.py6# This file contains code derived from PyTorch-Wavelet-Toolbox:COMMENT
MEDIUMsrc/peft/tuners/adaption_prompt/model.py229 # The following classmethods mirror the state dict serialization hooks of BaseTuner, which AdaptionPromptModelCOMMENT
MEDIUMsrc/peft/tuners/osf/model.py103 # Create a new or update an existing OSF layer in placeCOMMENT
MEDIUMsrc/peft/tuners/xlora/model.py244 # Create an empty LoraModelCOMMENT
MEDIUMsrc/peft/tuners/adalora/model.py371 """This method is not supported for AdaLoRA, use LoRA instead."""STRING
Excessive Try-Catch Wrapping64 hits · 65 pts
SeverityFileLineSnippetContext
LOWtests/testing_utils.py374 except Exception:CODE
MEDIUMtests/test_initialization.py327def test_lora_init_orthogonal_half_precision_dtype(self, dtype):CODE
LOWtests/test_initialization.py330 except Exception:CODE
LOWtests/test_arrow.py336 except Exception:CODE
LOWtests/test_custom_models.py2887 except Exception:CODE
LOWtests/test_custom_models.py2927 except Exception:CODE
LOWtests/test_custom_models.py2966 except Exception:CODE
LOWtests/test_custom_models.py3005 except Exception:CODE
LOWtests/regression/test_state_dict.py621 except Exception:CODE
LOWmethod_comparison/app.py188 except Exception as exc:CODE
LOWmethod_comparison/app.py198 except Exception as exc:CODE
LOWmethod_comparison/app.py232 except Exception as exc:CODE
LOWmethod_comparison/app.py393 except Exception as exc:CODE
LOWmethod_comparison/app.py443 except Exception as exc:CODE
LOWmethod_comparison/app.py496 except Exception as e:CODE
LOWmethod_comparison/app.py518 except Exception as e:CODE
LOWmethod_comparison/image-gen/run.py567 except Exception as exc:CODE
LOWmethod_comparison/image-gen/run.py697 except Exception as exc:CODE
LOWmethod_comparison/image-gen/utils.py310 except Exception as exc:CODE
LOWmethod_comparison/image-gen/utils.py318 except Exception as exc:CODE
LOW⚡method_comparison/image-gen/utils.py334 except Exception as exc:CODE
LOW⚡method_comparison/image-gen/utils.py342 except Exception as exc:CODE
LOW⚡method_comparison/image-gen/utils.py350 except Exception as exc:CODE
LOW⚡method_comparison/image-gen/utils.py358 except Exception as exc:CODE
LOWmethod_comparison/image-gen/evaluate.py139 except Exception as exc:CODE
LOWmethod_comparison/image-gen/evaluate.py261 except Exception as exc:CODE
LOWmethod_comparison/text_generation_benchmark/run.py214 except Exception as exc:CODE
LOWmethod_comparison/text_generation_benchmark/run.py299 except Exception as exc:CODE
LOWmethod_comparison/MetaMathQA/run.py400 except Exception as exc:CODE
LOWmethod_comparison/MetaMathQA/utils.py365 except Exception as exc:CODE
LOWmethod_comparison/MetaMathQA/utils.py381 except Exception as exc:CODE
LOWmethod_comparison/MetaMathQA/utils.py389 except Exception as exc:CODE
LOWmethod_comparison/MetaMathQA/utils.py518 except Exception as exc:CODE
LOWmethod_comparison/MetaMathQA/utils.py526 except Exception as exc:CODE
LOWexamples/ephemeral_gpu_offloading/load_with_dora.py75 except Exception as e:CODE
LOWexamples/ephemeral_gpu_offloading/load_with_dora.py80 except Exception as e:CODE
LOWexamples/qalora_finetuning/qalora_gptq_finetuning.py69 except Exception as e:CODE
LOWexamples/adamss_finetuning/test_adamss_quick.py169except Exception as e:CODE
MEDIUMscripts/check_doc_coverage.py564 print(f"Error: source path not found: {args.src}", file=sys.stderr)CODE
MEDIUMscripts/check_doc_coverage.py567 print(f"Error: docs path not found: {args.docs}", file=sys.stderr)CODE
LOWscripts/check_doc_coverage.py271 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py283 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py303 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py326 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py362 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py394 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py460 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py514 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py580 except Exception as exc:CODE
LOWscripts/generate_method_capabilities.py588 except Exception as exc:CODE
MEDIUMscripts/generate_method_capabilities.py352def run(self) -> Finding:CODE
LOWsrc/peft/config.py116 except Exception:STRING
LOWsrc/peft/config.py262 except Exception as exc:STRING
LOWsrc/peft/config.py331 except Exception:STRING
MEDIUMsrc/peft/peft_model.py222def active_adapters(self) -> list[str]:CODE
LOWsrc/peft/peft_model.py1180 except Exception: # something went wrong, roll backCODE
LOWsrc/peft/peft_model.py2366 except Exception:CODE
LOWsrc/peft/peft_model.py2721 except Exception:CODE
LOWsrc/peft/mixed_model.py245 except Exception: # something went wrong, roll backCODE
LOWsrc/peft/helpers.py157 except Exception:CODE
4 more matches not shown…
AI Structural Patterns61 hits · 57 pts
SeverityFileLineSnippetContext
LOWtests/testing_utils.py287CODE
LOWtests/test_lora_variants.py75CODE
LOWtests/test_torch_compile.py146CODE
LOWmethod_comparison/text_generation_benchmark/run_base.py122CODE
LOWmethod_comparison/text_generation_benchmark/utils.py279CODE
LOWexamples/boft_controlnet/utils/pipeline_controlnet.py166CODE
LOWexamples/boft_controlnet/utils/unet_2d_condition.py38CODE
LOWexamples/waveft_finetuning/waveft_finetuning.py30CODE
LOWexamples/hira_finetuning/hira_finetuning.py26CODE
LOWexamples/glora_finetuning/glora_finetuning.py26CODE
LOWexamples/olora_finetuning/olora_finetuning.py30CODE
LOWexamples/shira_finetuning/shira_finetuning.py31CODE
LOWexamples/corda_finetuning/datautils.py95CODE
LOWexamples/astra_finetuning/datautils.py95CODE
LOWscripts/train_memory.py106CODE
LOWsrc/peft/peft_model.py2024CODE
LOWsrc/peft/peft_model.py2206CODE
LOWsrc/peft/peft_model.py2546CODE
LOWsrc/peft/peft_model.py2860CODE
LOWsrc/peft/peft_model.py3089CODE
LOWsrc/peft/peft_model.py3160CODE
LOWsrc/peft/utils/incremental_pca.py46CODE
LOWsrc/peft/utils/healthcheck.py261CODE
LOWsrc/peft/utils/healthcheck.py351CODE
LOWsrc/peft/tuners/hra/layer.py297CODE
LOWsrc/peft/tuners/hra/layer.py476CODE
LOWsrc/peft/tuners/loha/layer.py245CODE
LOWsrc/peft/tuners/lokr/layer.py313CODE
LOWsrc/peft/tuners/vera/layer.py289CODE
LOWsrc/peft/tuners/delora/layer.py267CODE
LOWsrc/peft/tuners/boft/layer.py651CODE
LOWsrc/peft/tuners/boft/layer.py1001CODE
LOWsrc/peft/tuners/waveft/layer.py289CODE
LOWsrc/peft/tuners/c3a/layer.py202CODE
LOWsrc/peft/tuners/frod/layer.py346CODE
LOWsrc/peft/tuners/road/layer.py397CODE
LOWsrc/peft/tuners/fourierft/layer.py191CODE
LOWsrc/peft/tuners/vblora/layer.py253CODE
LOWsrc/peft/tuners/gralora/layer.py387CODE
LOWsrc/peft/tuners/adaption_prompt/layer.py139CODE
LOWsrc/peft/tuners/unilora/layer.py253CODE
LOWsrc/peft/tuners/tinylora/layer.py417CODE
LOWsrc/peft/tuners/miss/layer.py380CODE
LOWsrc/peft/tuners/ia3/layer.py353CODE
LOWsrc/peft/tuners/xlora/layer.py139CODE
LOWsrc/peft/tuners/xlora/layer.py250CODE
LOWsrc/peft/tuners/pvera/layer.py320CODE
LOWsrc/peft/tuners/lora/variants.py255CODE
LOWsrc/peft/tuners/lora/variants.py363CODE
LOWsrc/peft/tuners/lora/variants.py465CODE
LOWsrc/peft/tuners/lora/variants.py920CODE
LOWsrc/peft/tuners/lora/variants.py1249CODE
LOWsrc/peft/tuners/lora/variants.py1567CODE
LOWsrc/peft/tuners/lora/eva.py655CODE
LOWsrc/peft/tuners/lora/layer.py853CODE
LOWsrc/peft/tuners/lora/layer.py2315CODE
LOWsrc/peft/tuners/randlora/layer.py346CODE
LOWsrc/peft/tuners/oft/layer.py659CODE
LOWsrc/peft/tuners/oft/layer.py917CODE
LOWsrc/peft/tuners/deft/layer.py353CODE
1 more matches not shown…
Redundant / Tautological Comments28 hits · 46 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_xlora.py317 # Set it to 2 and make sure it actually isCOMMENT
LOW⚡tests/test_xlora.py322 # Set it to None and make sure it is 1/nCOMMENT
LOW⚡tests/test_lorafa.py303 # Check if lora_A weights have not changedCOMMENT
LOW⚡tests/test_lorafa.py308 # Check if lora_B weights are non-zeroCOMMENT
LOW⚡tests/test_lorafa.py334 # Check if lora_A weights have not changedCOMMENT
LOW⚡tests/test_lorafa.py339 # Check if lora_B weights are non-zero and if they follow the expected relationCOMMENT
LOWtests/test_lorafa.py371 # Check if all non-LoRA params also follow the expected relationCOMMENT
LOW⚡tests/test_config.py461 # Check if the user supplied timing values that will certainly fail because it breaksSTRING
LOWmethod_comparison/MetaMathQA/utils.py450 # Check if the string represents a fraction.COMMENT
LOWexamples/waveft_finetuning/waveft_finetuning.py50 # Set device_map to the right place when enabling DDP.COMMENT
LOWexamples/olora_finetuning/olora_finetuning.py51 # Set device_map to the right place when enabling DDP.COMMENT
LOWexamples/alora_finetuning/alora_finetuning.py186 # Print resultsCOMMENT
LOWexamples/qalora_finetuning/qalora_gptq_finetuning.py50 # Check if the model has GPTQ quantization attributesCOMMENT
LOWexamples/qalora_finetuning/qalora_gptq_finetuning.py78 # Check if we already have a cached quantized versionCOMMENT
LOWexamples/shira_finetuning/shira_finetuning.py49 # Set device_map to the right place when enabling DDP.COMMENT
LOWexamples/sft/utils.py194 # Check if the model is quantizedCOMMENT
LOW…s/int8_training/peft_adalora_whisper_large_training.py707 # Check if rank_pattern exists before calling update_and_allocateCOMMENT
LOW⚡src/peft/utils/other.py1644 # Check if this is the embedding layer (use endswith to allow flexible matching)COMMENT
LOW⚡src/peft/utils/other.py1649 # Check if this target layer matches any tied module (considering nested structures)COMMENT
LOW⚡src/peft/utils/other.py1657 # Check if all tied layers have the same indicesCOMMENT
LOWsrc/peft/tuners/tuners_utils.py2325 # Check if adding this suffix covers the itemCOMMENT
LOWsrc/peft/tuners/adamss/model.py98 # Check if already an Adamss layerCOMMENT
LOWsrc/peft/tuners/hira/layer.py176 fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out)CODE
LOWsrc/peft/tuners/hira/layer.py297 fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out)CODE
LOWsrc/peft/tuners/adalora/config.py94 # Check if 'r' has been set to a non-default valueCOMMENT
LOWsrc/peft/tuners/lora/loraga.py136 # Check if any supported layers were foundCOMMENT
LOWsrc/peft/tuners/oft/layer.py520 fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out)CODE
LOWsrc/peft/tuners/oft/layer.py678 fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out)CODE
AI Slop Vocabulary19 hits · 44 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_trainable_tokens.py800 # for this we can leverage the fact that emb_out(1/emb_in(x)) is embed_dim on theCOMMENT
MEDIUMtests/test_trainable_tokens.py837 # for this we can leverage the fact that emb_out(1/emb_in(x)) is embed_dim on theCOMMENT
MEDIUMtests/test_trainable_tokens.py898 # for this we can leverage the fact that emb_out(1/emb_in(x)) is embed_dim on theCOMMENT
MEDIUM⚡tests/test_gpu_examples.py5938 # increase the scale of the LoRA weights so that the difference between adapters is more pronounced, making COMMENT
MEDIUM⚡tests/test_initialization.py1619 # some arguments don't work in conjunction with lora_bias and should raiseCOMMENT
LOWtests/test_decoder_models.py574 # a malicious prompt tuning model. This is because PEFT would just pass the on the tokenizer_kwargs defined inCOMMENT
MEDIUMtests/test_multitask_prompt_tuning.py326 # PEFT forward and is thus robust to changes in transformers' generate.COMMENT
LOWtests/test_other.py466 # aware that some of the passing tests may just pass owing to randomness.COMMENT
MEDIUMtests/test_custom_models.py8304 # robust and minimal FSDP setupCOMMENT
LOWexamples/dora_finetuning/dora_finetuning.py73 use_dora=use_dora, # to use Dora OR compare to Lora just set the --use_doraCODE
MEDIUMsrc/peft/peft_model.py1058 # TODO: consider replacing this patching of methods with a more robust mechanism: setting a flag andCOMMENT
LOWsrc/peft/utils/other.py1850 # technically it would be sufficient to just return candidates since that contains all the keys ofCOMMENT
LOWsrc/peft/utils/transformers_weight_conversion.py493 # If, for any reason, we cannot apply conversion, we just return the PEFT config as is.COMMENT
MEDIUMsrc/peft/tuners/tuners_utils.py940 # TODO: check if this the most robust waySTRING
LOWsrc/peft/tuners/tuners_utils.py327 # model, just add a `peft_config` dict attribute to your model.STRING
MEDIUMsrc/peft/tuners/hra/layer.py165 # If we just compute I - V V^T to facilitate parallel computation, we will not get theseCOMMENT
LOWsrc/peft/tuners/adamss/layer.py392 # so just call base_layer directly (no adapter delta needed).COMMENT
LOWsrc/peft/tuners/lora/conversion.py338 # effective rank is the same and target_modules are a set, just add the nameCOMMENT
MEDIUMsrc/peft/tuners/lora/layer.py394 # check without importing bitsandbytes and robust to bnb_4bit_quant_storage=float*COMMENT
Docstring Block Structure6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHexamples/boft_controlnet/utils/pipeline_controlnet.py196 Function invoked when calling the pipeline for generation. Args: prompt (`str` or `List[stSTRING
HIGHexamples/qalora_finetuning/qalora_gptq_finetuning.py109 Tokenize text data and prepare it for language modeling. Args: examples: Dataset examples with 'text' STRING
HIGHsrc/peft/peft_model.py3348Get the status of each adapter layer in the model. This function returns a list of `TunerLayerStatus` dataclass insSTRING
HIGHsrc/peft/peft_model.py3482Get the status of tuners of the model. This function returns a `TunerModelStatus` dataclass instance, which containSTRING
HIGHsrc/peft/tuners/tuners_utils.py390 A private method to prepare the adapter config. For transformers based models, if `peft_config.target_STRING
HIGHsrc/peft/tuners/tuners_utils.py2256Find the minimal set of target modules that is sufficient to separate them from the other modules. Sometimes, a verSTRING
Structural Annotation Overuse13 hits · 27 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_adamss_asa.py107 # Step 1: train so B becomes non-zeroCOMMENT
LOW⚡tests/test_adamss_asa.py113 # Step 2: now gradients for A should be non-zeroCOMMENT
LOW⚡tests/test_adamss_asa.py123 # Step 3: another update should change scores via EMACOMMENT
LOW⚡tests/test_adamss_asa.py166 # Step 0: train to make B non-zeroCOMMENT
LOWexamples/lora_ga_finetuning/README.md38# Step 1: Create LoRA-GA configCOMMENT
LOW⚡examples/lora_ga_finetuning/README.md54# Step 2: Preprocess with LoRA-GA to estimate gradientsCOMMENT
LOW⚡examples/lora_ga_finetuning/README.md57# Step 3: Create PEFT model with LoRA-GA initializationCOMMENT
LOW⚡examples/lora_ga_finetuning/README.md60# Step 4: Train normallyCOMMENT
LOW⚡examples/lora_ga_finetuning/README.md68# Step 5: Save the trained adapterCOMMENT
LOWexamples/lora_ga_finetuning/README.md211### Step 1: Estimate gradients with full-precision modelCOMMENT
LOWexamples/lora_ga_finetuning/README.md250### Step 2: Load quantized model and apply LoRA-GACOMMENT
LOW⚡src/peft/tuners/adamss/model.py193 # Step 1: accumulate importance EVERY step during warmupCOMMENT
LOW⚡src/peft/tuners/adamss/model.py198 # Step 2: at mask intervals → schedule, global mask, then resetCOMMENT
Cross-Language Confusion6 hits · 18 pts
SeverityFileLineSnippetContext
HIGHmethod_comparison/MetaMathQA/run_with_jobs.py87 + "pip uninstall mslk torchao -y -q 2>/dev/null; " # TODO remove once this issue is resolvedCODE
HIGHsrc/peft/peft_model.py1953 trainable params: 370178 || all params: 108680450 || trainable%: 0.3406113979101117STRING
HIGHsrc/peft/peft_model.py2196 trainable params: 1843200 || all params: 775873280 || trainable%: 0.23756456724479544STRING
HIGHsrc/peft/peft_model.py2536 trainable params: 884736 || all params: 223843584 || trainable%: 0.3952474242013566STRING
HIGHsrc/peft/peft_model.py2792 trainable params: 370178 || all params: 108680450 || trainable%: 0.3406113979101117STRING
HIGHsrc/peft/peft_model.py3019 trainable params: 592900 || all params: 108312580 || trainable%: 0.5473971721475013STRING
Verbosity Indicators7 hits · 15 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_adamss_asa.py107 # Step 1: train so B becomes non-zeroCOMMENT
LOW⚡tests/test_adamss_asa.py113 # Step 2: now gradients for A should be non-zeroCOMMENT
LOW⚡tests/test_adamss_asa.py123 # Step 3: another update should change scores via EMACOMMENT
LOW⚡tests/test_adamss_asa.py166 # Step 0: train to make B non-zeroCOMMENT
LOWsrc/peft/import_utils.py113 # We need to check if `xla_device` can be found, will raise a RuntimeError if notCOMMENT
LOW⚡src/peft/tuners/adamss/model.py193 # Step 1: accumulate importance EVERY step during warmupCOMMENT
LOW⚡src/peft/tuners/adamss/model.py198 # Step 2: at mask intervals → schedule, global mask, then resetCOMMENT
Slop Phrases7 hits · 10 pts
SeverityFileLineSnippetContext
LOWtests/regression/test_regression.py189 model output, and load_base_model(name) to load the base model. Don't forget to fix the seed in load_base_model.STRING
MEDIUMexamples/beft_finetuning/beft_finetuning.py68# you can try target_modules=["v"], target_modules=["q"], target_modules=["k"]COMMENT
LOW…ture_extraction/peft_lora_embedding_semantic_search.py157 # make sure to pop weight so that corresponding model is not saved againCOMMENT
MEDIUMexamples/arrow_multitask/arrow_phi3_mini.py57This script is mainly meant for demonstration purposes and lightweight evaluation,STRING
MEDIUMexamples/alora_finetuning/alora_finetuning.py168 Purely for demonstration purposes. See the [paper](https://huggingface.co/papers/2504.12397)STRING
LOW…s/int8_training/peft_adalora_whisper_large_training.py325 # make sure to pop weight so that corresponding model is not saved againCOMMENT
LOWsrc/peft/tuners/lora/intruders.py115 # we're not modifying the weights since there are no intruders but we make sure to copy theCOMMENT
Fake / Example Data5 hits · 6 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_config.py716 self, tmp_path, attribute_name, nested_config_cls, dummy_field, dummy_valueCODE
LOW⚡tests/test_config.py719 setattr(config, attribute_name, nested_config_cls(**{dummy_field: dummy_value}))CODE
LOW⚡tests/test_config.py726 assert getattr(nested, dummy_field) == dummy_valueCODE
LOWtests/test_config.py703 "attribute_name, nested_config_cls, dummy_field, dummy_value",CODE
LOWdocs/source/package_reference/lora.md814invocation_string = "placeholder"CODE
TODO Padding5 hits · 6 pts
SeverityFileLineSnippetContext
LOWtests/testing_common.py1955 # TODO: add tests to check if disabling adapters works after calling merge_adapterSTRING
LOWsrc/peft/peft_model.py3623 # TODO: consider adding info about tied modules (_get_module_names_tied_with_embedding) and DTensors hereCOMMENT
LOWsrc/peft/tuners/xlora/layer.py122 # TODO: implement X-LoRA with Lora+Dora layersCOMMENT
LOWsrc/peft/tuners/xlora/layer.py176 # TODO: implement X-LoRA with Lora+Dora layersCOMMENT
LOWsrc/peft/tuners/xlora/layer.py233 # TODO: implement X-LoRA with Lora+Dora layersCOMMENT