wip refactor
This commit is contained in:
parent
11ea9eeaa7
commit
5acb6809ed
5 changed files with 292 additions and 232 deletions
7
utils.py
Normal file
7
utils.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from peft.utils import _get_submodules
|
||||
import torch
|
||||
|
||||
|
||||
def replace_module(model, key: str, module: torch.nn.Module):
|
||||
parent, target, target_name = _get_submodules(model, key)
|
||||
setattr(parent, target_name, module)
|
||||
Loading…
Add table
Add a link
Reference in a new issue