Former-commit-id: c025a4d74f293c14c2705e68af20a82a84608520
This commit is contained in:
hoshi-hiyouga 2024-06-08 00:45:02 +08:00 committed by GitHub
parent 3f6b3eed98
commit adbebb0e3f

View File

@ -239,7 +239,7 @@ def init_adapter(
)
model = get_peft_model(model, lora_config)
if cast_trainable_params_to_fp32:
if is_trainable and cast_trainable_params_to_fp32:
for param in filter(lambda p: p.requires_grad, model.parameters()):
param.data = param.data.to(torch.float32)