Make sure custom configs work with Transformers (#15569)

* Make sure custom configs work with Transformers

* Apply code review suggestions
This commit is contained in:
Sylvain Gugger
2022-02-09 10:04:44 -05:00
committed by GitHub
parent 7732d0fe7a
commit 1f60bc46f3
5 changed files with 37 additions and 6 deletions

View File

@@ -7,3 +7,10 @@ class CustomConfig(PretrainedConfig):
def __init__(self, attribute=1, **kwargs):
self.attribute = attribute
super().__init__(**kwargs)
class NoSuperInitConfig(PretrainedConfig):
model_type = "custom"
def __init__(self, attribute=1, **kwargs):
self.attribute = attribute