fix bug for mefture (#5299)

pull/5267/merge
Desperado-Jia 2024-01-22 22:17:54 +08:00 committed by GitHub
parent f7e3f82a7e
commit ddf879e2db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -16,7 +16,10 @@ import torch
def unwrap(model):
return model.unwrap().module
if hasattr(model, "module"):
return unwrap_model(model.module)
else:
return model
def neftune_post_forward_hook(module, input, output):