Add from_pretrained to dummy timm objects (#12097)
* Add from_pretrained to dummy timm * Fix at the source * Update utils/check_dummies.py Co-authored-by: Lysandre Debut <lysandre@huggingface.co> * Missing pretrained dummies * Style Co-authored-by: Sylvain Gugger <sylvain.gugger@gmail.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
@@ -39,8 +39,8 @@ class {0}:
|
||||
requires_backends(self, {1})
|
||||
|
||||
@classmethod
|
||||
def from_pretrained(self, *args, **kwargs):
|
||||
requires_backends(self, {1})
|
||||
def from_pretrained(cls, *args, **kwargs):
|
||||
requires_backends(cls, {1})
|
||||
"""
|
||||
|
||||
DUMMY_CLASS = """
|
||||
@@ -103,11 +103,14 @@ def read_init():
|
||||
def create_dummy_object(name, backend_name):
|
||||
"""Create the code for the dummy object corresponding to `name`."""
|
||||
_pretrained = [
|
||||
"Config" "ForCausalLM",
|
||||
"Config",
|
||||
"ForCausalLM",
|
||||
"ForConditionalGeneration",
|
||||
"ForMaskedLM",
|
||||
"ForMultipleChoice",
|
||||
"ForObjectDetection",
|
||||
"ForQuestionAnswering",
|
||||
"ForSegmentation",
|
||||
"ForSequenceClassification",
|
||||
"ForTokenClassification",
|
||||
"Model",
|
||||
|
||||
Reference in New Issue
Block a user