mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-15 16:18:10 +08:00
parent
a57d839e1d
commit
c548ad5e69
@ -110,6 +110,9 @@ def load_model(
|
|||||||
if not is_trainable:
|
if not is_trainable:
|
||||||
model.requires_grad_(False)
|
model.requires_grad_(False)
|
||||||
model.eval()
|
model.eval()
|
||||||
|
for param in model.parameters():
|
||||||
|
if param.device.type == "cuda":
|
||||||
|
param.data = param.data.to(model_args.compute_dtype)
|
||||||
else:
|
else:
|
||||||
model.train()
|
model.train()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user