Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
| BIT_START_DOCSTRING, | ||
| ) | ||
| class BitBackbone(BitPreTrainedModel): | ||
| class BitBackbone(BitPreTrainedModel, BackboneBaseModel): |
There was a problem hiding this comment.
It's not really convenient that any backbone will need to inherit from 2 classes can we directly incorporate this into PreTrainedModel or not?
There was a problem hiding this comment.
I don't see where the problem lies. That's the most Pythonic way of doing this (compared to having all models inherit from GenerationMixin for instance, whereas lots of them shouldn't). You give the type to objects that need it (and only those).
| BIT_START_DOCSTRING, | ||
| ) | ||
| class BitBackbone(BitPreTrainedModel): | ||
| class BitBackbone(BitPreTrainedModel, BackboneBaseModel): |
There was a problem hiding this comment.
I don't see where the problem lies. That's the most Pythonic way of doing this (compared to having all models inherit from GenerationMixin for instance, whereas lots of them shouldn't). You give the type to objects that need it (and only those).
|
Oh by the way, this is definition of a mixin in Python and the base class should be called |
* add BackboneBaseModel * add BackboneBaseModel * Rename to BackboneMixin * remove nn.Module Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
What does this PR do?
Add
BackboneMixinwith a methodforward_with_filtered_kwargs.