fix #2732
This commit is contained in:
parent
bdb496644c
commit
18ffce36b5
|
@ -109,7 +109,10 @@ def load_model(
|
||||||
|
|
||||||
if not is_trainable:
|
if not is_trainable:
|
||||||
model.requires_grad_(False)
|
model.requires_grad_(False)
|
||||||
model = model.to(model_args.compute_dtype) if not getattr(model, "quantization_method", None) else model
|
if not getattr(model, "quantization_method", None):
|
||||||
|
for param in filter(lambda p: p.device.type == "cuda", model.parameters()):
|
||||||
|
param.data = param.data.to(model_args.compute_dtype)
|
||||||
|
|
||||||
model.eval()
|
model.eval()
|
||||||
else:
|
else:
|
||||||
model.train()
|
model.train()
|
||||||
|
|
Loading…
Reference in New Issue