mirror of
https://github.com/wassname/peft.git
synced 2026-09-10 12:20:21 +08:00
Merge pull request #9 from huggingface/smangrul/add-examples-fixes-docs
fixes
This commit is contained in:
@@ -178,7 +178,7 @@ class PETModelForSequenceClassification(PETModel):
|
||||
break
|
||||
|
||||
# to make sure classifier layer is trainable
|
||||
_set_trainable(self.base_model)
|
||||
_set_trainable(self)
|
||||
|
||||
def forward(
|
||||
self,
|
||||
@@ -540,7 +540,7 @@ class PETModelForTokenClassification(PETModel):
|
||||
break
|
||||
|
||||
# to make sure classifier layer is trainable
|
||||
_set_trainable(self.base_model)
|
||||
_set_trainable(self)
|
||||
|
||||
def forward(
|
||||
self,
|
||||
|
||||
@@ -42,8 +42,6 @@ def _set_trainable(model):
|
||||
for name, param in model.named_parameters():
|
||||
if any(module_name in name for module_name in model.modules_to_save):
|
||||
param.requires_grad = True
|
||||
else:
|
||||
param.requires_grad = False
|
||||
|
||||
|
||||
def fsdp_auto_wrap_policy(model):
|
||||
|
||||
Reference in New Issue
Block a user