"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "e54a1b49aa6268c484625c6374f952f318914743"
Unverified Commit d324b70f authored by Younes Belkada's avatar Younes Belkada Committed by GitHub
Browse files

[`bnb`] Force `requires_grad` to be `False` (#22396)

for rg to be `False`
parent 7dcd8703
...@@ -133,6 +133,8 @@ def replace_8bit_linear(model, threshold=6.0, modules_to_not_convert=None, curre ...@@ -133,6 +133,8 @@ def replace_8bit_linear(model, threshold=6.0, modules_to_not_convert=None, curre
has_fp16_weights=False, has_fp16_weights=False,
threshold=threshold, threshold=threshold,
) )
# Force requires grad to False to avoid unexpected errors
model._modules[name].requires_grad_(False)
# Remove the last key for recursion # Remove the last key for recursion
current_key_name.pop(-1) current_key_name.pop(-1)
return model return model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment