mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 10:12:23 +06:00
parent
7dcd8703ef
commit
d324b70f00
@ -133,6 +133,8 @@ def replace_8bit_linear(model, threshold=6.0, modules_to_not_convert=None, curre
|
||||
has_fp16_weights=False,
|
||||
threshold=threshold,
|
||||
)
|
||||
# Force requires grad to False to avoid unexpected errors
|
||||
model._modules[name].requires_grad_(False)
|
||||
# Remove the last key for recursion
|
||||
current_key_name.pop(-1)
|
||||
return model
|
||||
|
Loading…
Reference in New Issue
Block a user