Update rl_replacements.py
This commit is contained in:
parent
ff3375ee8e
commit
c987094751
1 changed files with 2 additions and 2 deletions
|
|
@ -125,12 +125,12 @@ def grpo_trainer__prepare_inputs(function_name, function):
|
|||
if "with torch.inference_mode()" not in function: return function
|
||||
|
||||
function = function.replace(
|
||||
"with torch.inference_mode()",
|
||||
"with torch.inference_mode():",
|
||||
|
||||
"with torch.inference_mode(), "\
|
||||
"torch.amp.autocast(device_type = 'cuda', "\
|
||||
"dtype = torch.float16 if os.environ.get('ACCELERATE_MIXED_PRECISION', 'fp16') == 'fp16' else torch.bfloat16) "\
|
||||
"if not torch.is_autocast_enabled('cuda') else nullcontext()",
|
||||
"if not torch.is_autocast_enabled('cuda') else nullcontext():",
|
||||
)
|
||||
return function
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue