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