-
Notifications
You must be signed in to change notification settings - Fork 6.6k
add post init for safty checker #12794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: jiqing-feng <[email protected]>
|
|
||
| self.concept_embeds_weights = nn.Parameter(torch.ones(17), requires_grad=False) | ||
| self.special_care_embeds_weights = nn.Parameter(torch.ones(3), requires_grad=False) | ||
| self.post_init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we condition this based on the transformers version being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to use try except?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, opinion it's better to be explicit about conditioning with versioning since we know that it's a versioning problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, done.
|
Hi @sayakpaul . Please let me know what needs to be changed before merging. Thanks! |
|
@bot /style |
|
Style bot fixed some files and pushed the changes. |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
Thanks! |
Signed-off-by: jiqing-feng <[email protected]>
Fix safety checker loading issue: huggingface/transformers#42544 .
Hi @sayakpaul . Please review this PR. Thanks!