set new linear status (#9639)
This commit is contained in:
parent
499100daf1
commit
5636b0ba80
1 changed files with 2 additions and 0 deletions
|
|
@ -258,6 +258,8 @@ def _replace_with_low_bit_linear(model, qtype, modules_to_not_convert=None,
|
||||||
|
|
||||||
# fp16 may generalize to other sizes later
|
# fp16 may generalize to other sizes later
|
||||||
if new_linear is not None:
|
if new_linear is not None:
|
||||||
|
if not module.training:
|
||||||
|
new_linear.eval()
|
||||||
model._modules[name] = new_linear
|
model._modules[name] = new_linear
|
||||||
has_been_replaced = True
|
has_been_replaced = True
|
||||||
# Force requires grad to False to avoid unexpected errors
|
# Force requires grad to False to avoid unexpected errors
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue