Fix OOM from prepare_model_for_kbit_training overwriting peft_config patching
This commit is contained in:
parent
46fc68f38c
commit
d892dc6884
1 changed files with 9 additions and 6 deletions
|
|
@ -1627,12 +1627,15 @@ def patch_functions(RLTrainer, trainer_file, RLTrainer_name, all_imports, import
|
|||
for function in functions:
|
||||
if not hasattr(RLTrainer, function):
|
||||
continue
|
||||
fx = getattr(RLTrainer, function)
|
||||
try:
|
||||
source = inspect.getsource(fx)
|
||||
except:
|
||||
continue
|
||||
original_source = source
|
||||
if function in changed:
|
||||
original_source, source = changed[function]
|
||||
else:
|
||||
fx = getattr(RLTrainer, function)
|
||||
try:
|
||||
source = inspect.getsource(fx)
|
||||
except:
|
||||
continue
|
||||
original_source = source
|
||||
|
||||
# Check for function
|
||||
for edit_function in edit_functions:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue