-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Support resize_position_embeddings for layoutlm-models #2513
Conversation
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.
可以参考HF基类先加上NotImplemented的resize_position_embeddings
的接口
self.config["max_position_embeddings"] = new_num_position_embeddings | ||
|
||
old_position_embeddings_weight = self.embeddings.position_embeddings.weight.clone( | ||
) |
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.
这里是否一定要clone呢,不clone是否也行
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.
不 clone 也可以,已删除 clone 操作。
self.config["max_position_embeddings"] = new_num_position_embeddings | ||
|
||
old_position_embeddings_weight = self.embeddings.position_embeddings.weight.clone( | ||
) |
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.
这里是否一定要clone呢,不clone是否也行
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.
不 clone 也可以,已删除 clone 操作。
Done |
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.
LGTM
PR types
PR changes
Models
Description
Support resize_position_embeddings for layoutlm-models