compat peft 0.19#80
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces compatibility for peft version 0.19.0 and above by refactoring the update_layer method in src/mcore_bridge/tuners/lora.py to extract configuration parameters from a config object within kwargs. A critical issue was identified where the code could raise a KeyError if the config object is missing from kwargs while the peft_019 flag is enabled, and a suggestion was provided to safely check for the key's existence.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces compatibility for PEFT 0.19.0 in the LoRA tuner by modifying the update_layer method to handle configuration parameters passed via a config object. The reviewer identified a potential TypeError because lora_alpha is still defined as a mandatory keyword argument, which conflicts with how PEFT 0.19.0 provides arguments. Furthermore, the feedback points out that lora_alpha is missing from the extraction logic and recommends using .get() for safer dictionary access to ensure backward compatibility.
huggingface/peft#2960