Update rl.py
This commit is contained in:
parent
b9bcce89e9
commit
121785dd23
1 changed files with 4 additions and 1 deletions
|
|
@ -702,13 +702,16 @@ def patch_functions(RLTrainer, trainer_file, RLTrainer_name, all_imports, import
|
|||
)
|
||||
pass
|
||||
|
||||
|
||||
# Remove peft_config
|
||||
init = init.replace("elif peft_config is None:", "elif False:")
|
||||
init = init.replace("elif peft_config is not None:", "elif False:")
|
||||
init = init.replace("if peft_config is None:", "if False:")
|
||||
init = init.replace("if peft_config is not None:", "if False:")
|
||||
init = init.replace("get_peft_model(model, peft_config)", "model")
|
||||
# New TRL 0.20.0
|
||||
init = init.replace("if peft_config is not None or (is_peft_available() and isinstance(model, PeftModel)):", "if False:")
|
||||
# New TRL 0.20.0
|
||||
init = init.replace("model = self._prepare_peft_model(model, peft_config, args)\n", "pass\n")
|
||||
|
||||
# Set use_vllm if not set
|
||||
if "args.use_vllm" in init and "model" in init and "args" in init:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue