From 1b730c3d11fdad0180ee9f9d3da9cff933c3b264 Mon Sep 17 00:00:00 2001 From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:59:41 -0500 Subject: [PATCH] Better dummies (#15148) * Better dummies * See if this fixes the issue * Fix quality * Style * Add doc for DummyObject --- src/transformers/file_utils.py | 12 + src/transformers/utils/dummy_flax_objects.py | 1120 ++--- src/transformers/utils/dummy_pt_objects.py | 4161 +++++------------ ..._pytorch_quantization_and_torch_objects.py | 90 +- .../utils/dummy_scatter_objects.py | 50 +- .../dummy_sentencepiece_and_speech_objects.py | 11 +- ...my_sentencepiece_and_tokenizers_objects.py | 3 +- .../utils/dummy_sentencepiece_objects.py | 137 +- .../utils/dummy_speech_objects.py | 7 +- src/transformers/utils/dummy_tf_objects.py | 2239 +++------ .../utils/dummy_timm_and_vision_objects.py | 41 +- .../utils/dummy_tokenizers_objects.py | 269 +- .../utils/dummy_vision_objects.py | 61 +- utils/check_dummies.py | 77 +- utils/check_repo.py | 1 + 15 files changed, 2345 insertions(+), 5934 deletions(-) diff --git a/src/transformers/file_utils.py b/src/transformers/file_utils.py index aa910fdf832203..408df727ac9264 100644 --- a/src/transformers/file_utils.py +++ b/src/transformers/file_utils.py @@ -831,6 +831,18 @@ def requires_backends(obj, backends): raise ImportError("".join([BACKENDS_MAPPING[backend][1].format(name) for backend in backends])) +class DummyObject(type): + """ + Metaclass for the dummy objects. Any class inheriting from it will return the ImportError generated by + `requires_backend` each time a user tries to access any method of that class. + """ + + def __getattr__(cls, key): + if key.startswith("_"): + return super().__getattr__(cls, key) + requires_backends(cls, cls._backends) + + def add_start_docstrings(*docstr): def docstring_decorator(fn): fn.__doc__ = "".join(docstr) + (fn.__doc__ if fn.__doc__ is not None else "") diff --git a/src/transformers/utils/dummy_flax_objects.py b/src/transformers/utils/dummy_flax_objects.py index 52c0e5e1242ee5..675c7c5088132c 100644 --- a/src/transformers/utils/dummy_flax_objects.py +++ b/src/transformers/utils/dummy_flax_objects.py @@ -1,170 +1,131 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class FlaxForcedBOSTokenLogitsProcessor: +class FlaxForcedBOSTokenLogitsProcessor(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) +class FlaxForcedEOSTokenLogitsProcessor(metaclass=DummyObject): + _backends = ["flax"] -class FlaxForcedEOSTokenLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) +class FlaxLogitsProcessor(metaclass=DummyObject): + _backends = ["flax"] -class FlaxLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) +class FlaxLogitsProcessorList(metaclass=DummyObject): + _backends = ["flax"] -class FlaxLogitsProcessorList: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) +class FlaxLogitsWarper(metaclass=DummyObject): + _backends = ["flax"] -class FlaxLogitsWarper: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxMinLengthLogitsProcessor: +class FlaxMinLengthLogitsProcessor(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) +class FlaxTemperatureLogitsWarper(metaclass=DummyObject): + _backends = ["flax"] -class FlaxTemperatureLogitsWarper: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxTopKLogitsWarper: - def __init__(self, *args, **kwargs): - requires_backends(self, ["flax"]) - +class FlaxTopKLogitsWarper(metaclass=DummyObject): + _backends = ["flax"] -class FlaxTopPLogitsWarper: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxPreTrainedModel: +class FlaxTopPLogitsWarper(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAlbertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAlbertForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAlbertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAlbertForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAlbertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxAlbertForQuestionAnswering: +class FlaxAlbertForPreTraining(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAlbertForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAlbertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAlbertForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxAlbertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAlbertForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAlbertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAlbertModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAlbertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): +class FlaxAlbertPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) @@ -204,1320 +165,799 @@ def __call__(self, *args, **kwargs): FLAX_MODEL_MAPPING = None -class FlaxAutoModel: +class FlaxAutoModel(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForCausalLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForImageClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForNextSentencePrediction(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForPreTraining(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForSeq2SeqLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForSeq2SeqLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxAutoModelForVision2Seq(metaclass=DummyObject): + _backends = ["flax"] -class FlaxAutoModelForVision2Seq: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBartForConditionalGeneration(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxBartForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBartForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBartForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBartForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBartForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBartModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBartModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBartPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxBartPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBeitForImageClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBeitForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxBeitForMaskedImageModeling: +class FlaxBeitForMaskedImageModeling(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBeitModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBeitModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBeitPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxBeitPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertForNextSentencePrediction(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertForPreTraining(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxBertForQuestionAnswering: +class FlaxBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBertPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBigBirdForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBigBirdForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBigBirdForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBigBirdForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBigBirdForPreTraining(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBigBirdForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxBigBirdForQuestionAnswering: +class FlaxBigBirdForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBigBirdForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBigBirdForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBigBirdForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxBigBirdForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBigBirdModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBigBirdModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBigBirdPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBigBirdPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBlenderbotForConditionalGeneration(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBlenderbotForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBlenderbotModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBlenderbotModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBlenderbotPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBlenderbotPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBlenderbotSmallForConditionalGeneration(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBlenderbotSmallForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBlenderbotSmallModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBlenderbotSmallModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxBlenderbotSmallPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxBlenderbotSmallPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxCLIPModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxCLIPModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxCLIPPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxCLIPPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxCLIPTextModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxCLIPTextModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxCLIPTextPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxCLIPTextPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxCLIPVisionModel(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxCLIPVisionModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxCLIPVisionPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxCLIPVisionPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxDistilBertForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxDistilBertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxDistilBertForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxDistilBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxDistilBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] -class FlaxDistilBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxDistilBertForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxDistilBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxDistilBertForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxDistilBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxDistilBertModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxDistilBertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxDistilBertPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxDistilBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxElectraForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxElectraForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxElectraForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxElectraForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxElectraForPreTraining(metaclass=DummyObject): + _backends = ["flax"] -class FlaxElectraForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxElectraForQuestionAnswering: +class FlaxElectraForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxElectraForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxElectraForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxElectraForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxElectraForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxElectraModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxElectraModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxElectraPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxElectraPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxEncoderDecoderModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxEncoderDecoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPT2LMHeadModel(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxGPT2LMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPT2Model(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPT2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPT2PreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPT2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPTNeoForCausalLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPTNeoForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPTNeoModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPTNeoModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPTNeoPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPTNeoPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPTJForCausalLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPTJForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPTJModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPTJModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxGPTJPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxGPTJPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMarianModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMarianModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMarianMTModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMarianMTModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMarianPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMarianPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMBartForConditionalGeneration(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMBartForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMBartForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMBartForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMBartForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMBartForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMBartModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMBartModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMBartPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMBartPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMT5ForConditionalGeneration(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxMT5ForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxMT5Model(metaclass=DummyObject): + _backends = ["flax"] -class FlaxMT5Model: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxPegasusForConditionalGeneration(metaclass=DummyObject): + _backends = ["flax"] -class FlaxPegasusForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxPegasusModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxPegasusModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxPegasusPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxPegasusPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRobertaForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRobertaForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRobertaForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRobertaForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRobertaForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRobertaForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRobertaForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxRobertaForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRobertaForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRobertaForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRobertaModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRobertaModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRobertaPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRobertaPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRoFormerForMaskedLM(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxRoFormerForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRoFormerForMultipleChoice(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRoFormerForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRoFormerForQuestionAnswering(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxRoFormerForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRoFormerForSequenceClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRoFormerForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRoFormerForTokenClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRoFormerForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRoFormerModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRoFormerModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxRoFormerPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxRoFormerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxT5ForConditionalGeneration(metaclass=DummyObject): + _backends = ["flax"] -class FlaxT5ForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxT5Model(metaclass=DummyObject): + _backends = ["flax"] -class FlaxT5Model: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxT5PreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxT5PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxVisionEncoderDecoderModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxVisionEncoderDecoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxVisionTextDualEncoderModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxVisionTextDualEncoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxViTForImageClassification(metaclass=DummyObject): + _backends = ["flax"] -class FlaxViTForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxViTModel: +class FlaxViTModel(metaclass=DummyObject): + _backends = ["flax"] + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxViTPreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] -class FlaxViTPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxWav2Vec2ForCTC(metaclass=DummyObject): + _backends = ["flax"] -class FlaxWav2Vec2ForCTC: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -class FlaxWav2Vec2ForPreTraining: - def __init__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxWav2Vec2ForPreTraining(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxWav2Vec2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): - requires_backends(self, ["flax"]) +class FlaxWav2Vec2Model(metaclass=DummyObject): + _backends = ["flax"] - -class FlaxWav2Vec2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["flax"]) - def __call__(self, *args, **kwargs): +class FlaxWav2Vec2PreTrainedModel(metaclass=DummyObject): + _backends = ["flax"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) diff --git a/src/transformers/utils/dummy_pt_objects.py b/src/transformers/utils/dummy_pt_objects.py index a5e576b88450f1..57b43ab36374fd 100644 --- a/src/transformers/utils/dummy_pt_objects.py +++ b/src/transformers/utils/dummy_pt_objects.py @@ -1,214 +1,228 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class PyTorchBenchmark: +class PyTorchBenchmark(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class PyTorchBenchmarkArguments: +class PyTorchBenchmarkArguments(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class GlueDataset: +class GlueDataset(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class GlueDataTrainingArguments: +class GlueDataTrainingArguments(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LineByLineTextDataset: +class LineByLineTextDataset(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LineByLineWithRefDataset: +class LineByLineWithRefDataset(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LineByLineWithSOPTextDataset: +class LineByLineWithSOPTextDataset(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class SquadDataset: +class SquadDataset(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class SquadDataTrainingArguments: +class SquadDataTrainingArguments(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class TextDataset: +class TextDataset(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class TextDatasetForNextSentencePrediction: +class TextDatasetForNextSentencePrediction(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BeamScorer(metaclass=DummyObject): + _backends = ["torch"] -class BeamScorer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class BeamSearchScorer: +class BeamSearchScorer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class ForcedBOSTokenLogitsProcessor: +class ForcedBOSTokenLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class ForcedEOSTokenLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class ForcedEOSTokenLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class HammingDiversityLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class HammingDiversityLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class InfNanRemoveLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class InfNanRemoveLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class LogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class LogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class LogitsProcessorList(metaclass=DummyObject): + _backends = ["torch"] -class LogitsProcessorList: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class LogitsWarper(metaclass=DummyObject): + _backends = ["torch"] -class LogitsWarper: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MinLengthLogitsProcessor: +class MinLengthLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class NoBadWordsLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class NoBadWordsLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class NoRepeatNGramLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class NoRepeatNGramLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class PrefixConstrainedLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class PrefixConstrainedLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class RepetitionPenaltyLogitsProcessor(metaclass=DummyObject): + _backends = ["torch"] -class RepetitionPenaltyLogitsProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class TemperatureLogitsWarper(metaclass=DummyObject): + _backends = ["torch"] -class TemperatureLogitsWarper: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class TopKLogitsWarper: +class TopKLogitsWarper(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class TopPLogitsWarper: +class TopPLogitsWarper(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MaxLengthCriteria: +class MaxLengthCriteria(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MaxTimeCriteria: +class MaxTimeCriteria(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class StoppingCriteria: +class StoppingCriteria(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class StoppingCriteriaList: +class StoppingCriteriaList(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -217,20 +231,17 @@ def top_k_top_p_filtering(*args, **kwargs): requires_backends(top_k_top_p_filtering, ["torch"]) -class Conv1D: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class Conv1D(metaclass=DummyObject): + _backends = ["torch"] -class PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -245,94 +256,61 @@ def prune_layer(*args, **kwargs): ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class AlbertForMaskedLM: +class AlbertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AlbertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class AlbertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AlbertForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class AlbertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class AlbertForQuestionAnswering: +class AlbertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AlbertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class AlbertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AlbertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class AlbertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AlbertModel(metaclass=DummyObject): + _backends = ["torch"] -class AlbertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AlbertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class AlbertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_albert(*args, **kwargs): requires_backends(load_tf_weights_in_albert, ["torch"]) @@ -398,538 +376,345 @@ def load_tf_weights_in_albert(*args, **kwargs): MODEL_WITH_LM_HEAD_MAPPING = None -class AutoModel: +class AutoModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForAudioClassification(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForAudioClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForAudioFrameClassification(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForAudioFrameClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForAudioXVector(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForAudioXVector: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForCausalLM(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForCTC(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForCTC: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForImageClassification(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForImageSegmentation(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForImageSegmentation: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForNextSentencePrediction(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForObjectDetection(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForObjectDetection: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForSeq2SeqLM(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForSeq2SeqLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForSpeechSeq2Seq(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForSpeechSeq2Seq: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForTableQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForTableQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelForVision2Seq(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelForVision2Seq: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class AutoModelWithLMHead(metaclass=DummyObject): + _backends = ["torch"] -class AutoModelWithLMHead: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - BART_PRETRAINED_MODEL_ARCHIVE_LIST = None -class BartForCausalLM: +class BartForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BartForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class BartForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BartForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class BartForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BartForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class BartForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BartModel(metaclass=DummyObject): + _backends = ["torch"] -class BartModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BartPretrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class BartPretrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PretrainedBartModel(metaclass=DummyObject): + _backends = ["torch"] -class PretrainedBartModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - BEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class BeitForImageClassification: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BeitForImageClassification(metaclass=DummyObject): + _backends = ["torch"] - -class BeitForMaskedImageModeling: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BeitForMaskedImageModeling(metaclass=DummyObject): + _backends = ["torch"] -class BeitForSemanticSegmentation: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class BeitModel: +class BeitForSemanticSegmentation(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BeitModel(metaclass=DummyObject): + _backends = ["torch"] -class BeitPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class BeitPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class BertForMaskedLM: +class BertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class BertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertForNextSentencePrediction(metaclass=DummyObject): + _backends = ["torch"] -class BertForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class BertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class BertForQuestionAnswering: +class BertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class BertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class BertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertLayer(metaclass=DummyObject): + _backends = ["torch"] -class BertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class BertLMHeadModel: +class BertLMHeadModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertModel(metaclass=DummyObject): + _backends = ["torch"] -class BertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class BertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_bert(*args, **kwargs): requires_backends(load_tf_weights_in_bert, ["torch"]) -class BertGenerationDecoder: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BertGenerationDecoder(metaclass=DummyObject): + _backends = ["torch"] - -class BertGenerationEncoder: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class BertGenerationPreTrainedModel: +class BertGenerationEncoder(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class BertGenerationPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -940,111 +725,75 @@ def load_tf_weights_in_bert_generation(*args, **kwargs): BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST = None -class BigBirdForCausalLM: +class BigBirdForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class BigBirdForQuestionAnswering: +class BigBirdForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdLayer(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class BigBirdModel: +class BigBirdModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_big_bird(*args, **kwargs): requires_backends(load_tf_weights_in_big_bird, ["torch"]) @@ -1053,346 +802,213 @@ def load_tf_weights_in_big_bird(*args, **kwargs): BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = None -class BigBirdPegasusForCausalLM: +class BigBirdPegasusForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdPegasusForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdPegasusForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdPegasusForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdPegasusForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdPegasusForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdPegasusForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdPegasusModel(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdPegasusModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BigBirdPegasusPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class BigBirdPegasusPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class BlenderbotForCausalLM: +class BlenderbotForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BlenderbotForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class BlenderbotForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BlenderbotModel(metaclass=DummyObject): + _backends = ["torch"] -class BlenderbotModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BlenderbotPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class BlenderbotPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST = None -class BlenderbotSmallForCausalLM: +class BlenderbotSmallForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BlenderbotSmallForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class BlenderbotSmallForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BlenderbotSmallModel(metaclass=DummyObject): + _backends = ["torch"] -class BlenderbotSmallModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class BlenderbotSmallPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class BlenderbotSmallPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class CamembertForCausalLM: +class CamembertForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CamembertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class CamembertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CamembertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class CamembertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CamembertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class CamembertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CamembertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class CamembertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CamembertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class CamembertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CamembertModel(metaclass=DummyObject): + _backends = ["torch"] -class CamembertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - CANINE_PRETRAINED_MODEL_ARCHIVE_LIST = None -class CanineForMultipleChoice: +class CanineForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CanineForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class CanineForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CanineForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class CanineForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CanineForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class CanineForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CanineLayer(metaclass=DummyObject): + _backends = ["torch"] -class CanineLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class CanineModel: +class CanineModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CaninePreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class CaninePreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_canine(*args, **kwargs): requires_backends(load_tf_weights_in_canine, ["torch"]) @@ -1401,145 +1017,92 @@ def load_tf_weights_in_canine(*args, **kwargs): CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None -class CLIPModel: +class CLIPModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CLIPPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class CLIPPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CLIPTextModel(metaclass=DummyObject): + _backends = ["torch"] -class CLIPTextModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CLIPVisionModel(metaclass=DummyObject): + _backends = ["torch"] -class CLIPVisionModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class ConvBertForMaskedLM: +class ConvBertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ConvBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class ConvBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ConvBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class ConvBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ConvBertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class ConvBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ConvBertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class ConvBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ConvBertLayer(metaclass=DummyObject): + _backends = ["torch"] -class ConvBertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class ConvBertModel: +class ConvBertModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ConvBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class ConvBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_convbert(*args, **kwargs): requires_backends(load_tf_weights_in_convbert, ["torch"]) @@ -1548,327 +1111,206 @@ def load_tf_weights_in_convbert(*args, **kwargs): CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = None -class CTRLForSequenceClassification: +class CTRLForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CTRLLMHeadModel(metaclass=DummyObject): + _backends = ["torch"] - -class CTRLLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CTRLModel(metaclass=DummyObject): + _backends = ["torch"] -class CTRLModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class CTRLPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class CTRLPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class DebertaForMaskedLM: +class DebertaForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class DebertaForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class DebertaForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class DebertaForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaModel(metaclass=DummyObject): + _backends = ["torch"] -class DebertaModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class DebertaPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None -class DebertaV2ForMaskedLM: +class DebertaV2ForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaV2ForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class DebertaV2ForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaV2ForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class DebertaV2ForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaV2ForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class DebertaV2ForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaV2Model(metaclass=DummyObject): + _backends = ["torch"] -class DebertaV2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DebertaV2PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class DebertaV2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class DeiTForImageClassification: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DeiTForImageClassification(metaclass=DummyObject): + _backends = ["torch"] - -class DeiTForImageClassificationWithTeacher: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class DeiTModel: +class DeiTForImageClassificationWithTeacher(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DeiTModel(metaclass=DummyObject): + _backends = ["torch"] -class DeiTPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class DeiTPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class DistilBertForMaskedLM: +class DistilBertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DistilBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class DistilBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DistilBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class DistilBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DistilBertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class DistilBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DistilBertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class DistilBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DistilBertModel(metaclass=DummyObject): + _backends = ["torch"] -class DistilBertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DistilBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class DistilBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None @@ -1879,44 +1321,51 @@ def forward(self, *args, **kwargs): DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class DPRContextEncoder: +class DPRContextEncoder(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class DPRPretrainedContextEncoder: +class DPRPretrainedContextEncoder(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class DPRPreTrainedModel: +class DPRPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class DPRPretrainedQuestionEncoder(metaclass=DummyObject): + _backends = ["torch"] -class DPRPretrainedQuestionEncoder: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class DPRPretrainedReader: +class DPRPretrainedReader(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class DPRQuestionEncoder: +class DPRQuestionEncoder(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class DPRReader: +class DPRReader(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -1924,458 +1373,291 @@ def __init__(self, *args, **kwargs): ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class ElectraForCausalLM: +class ElectraForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ElectraForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class ElectraForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ElectraForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class ElectraForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ElectraForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class ElectraForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class ElectraForQuestionAnswering: +class ElectraForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ElectraForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class ElectraForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ElectraForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class ElectraForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ElectraModel(metaclass=DummyObject): + _backends = ["torch"] -class ElectraModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ElectraPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class ElectraPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_electra(*args, **kwargs): requires_backends(load_tf_weights_in_electra, ["torch"]) -class EncoderDecoderModel: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class EncoderDecoderModel(metaclass=DummyObject): + _backends = ["torch"] - def forward(self, *args, **kwargs): + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class FlaubertForMultipleChoice: +class FlaubertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FlaubertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class FlaubertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FlaubertForQuestionAnsweringSimple(metaclass=DummyObject): + _backends = ["torch"] -class FlaubertForQuestionAnsweringSimple: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FlaubertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class FlaubertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FlaubertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class FlaubertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FlaubertModel(metaclass=DummyObject): + _backends = ["torch"] -class FlaubertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FlaubertWithLMHeadModel(metaclass=DummyObject): + _backends = ["torch"] -class FlaubertWithLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - FNET_PRETRAINED_MODEL_ARCHIVE_LIST = None -class FNetForMaskedLM: +class FNetForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FNetForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class FNetForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FNetForNextSentencePrediction(metaclass=DummyObject): + _backends = ["torch"] -class FNetForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FNetForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class FNetForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class FNetForQuestionAnswering: +class FNetForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FNetForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class FNetForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FNetForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class FNetForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FNetLayer(metaclass=DummyObject): + _backends = ["torch"] -class FNetLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class FNetModel: +class FNetModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FNetPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class FNetPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FSMTForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class FSMTForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FSMTModel(metaclass=DummyObject): + _backends = ["torch"] -class FSMTModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PretrainedFSMTModel(metaclass=DummyObject): + _backends = ["torch"] -class PretrainedFSMTModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = None -class FunnelBaseModel: +class FunnelBaseModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FunnelForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class FunnelForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FunnelForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class FunnelForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FunnelForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class FunnelForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class FunnelForQuestionAnswering: +class FunnelForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FunnelForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class FunnelForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FunnelForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class FunnelForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FunnelModel(metaclass=DummyObject): + _backends = ["torch"] -class FunnelModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class FunnelPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class FunnelPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_funnel(*args, **kwargs): requires_backends(load_tf_weights_in_funnel, ["torch"]) @@ -2384,77 +1666,47 @@ def load_tf_weights_in_funnel(*args, **kwargs): GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = None -class GPT2DoubleHeadsModel: +class GPT2DoubleHeadsModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPT2ForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class GPT2ForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPT2ForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class GPT2ForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPT2LMHeadModel(metaclass=DummyObject): + _backends = ["torch"] -class GPT2LMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPT2Model(metaclass=DummyObject): + _backends = ["torch"] -class GPT2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPT2PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class GPT2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_gpt2(*args, **kwargs): requires_backends(load_tf_weights_in_gpt2, ["torch"]) @@ -2463,53 +1715,33 @@ def load_tf_weights_in_gpt2(*args, **kwargs): GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST = None -class GPTNeoForCausalLM: +class GPTNeoForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPTNeoForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class GPTNeoForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPTNeoModel(metaclass=DummyObject): + _backends = ["torch"] -class GPTNeoModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPTNeoPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class GPTNeoPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_gpt_neo(*args, **kwargs): requires_backends(load_tf_weights_in_gpt_neo, ["torch"]) @@ -2518,240 +1750,154 @@ def load_tf_weights_in_gpt_neo(*args, **kwargs): GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = None -class GPTJForCausalLM: +class GPTJForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPTJForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class GPTJForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPTJForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class GPTJForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPTJModel(metaclass=DummyObject): + _backends = ["torch"] -class GPTJModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class GPTJPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class GPTJPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class HubertForCTC: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class HubertForCTC(metaclass=DummyObject): + _backends = ["torch"] - -class HubertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class HubertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class HubertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class HubertModel(metaclass=DummyObject): + _backends = ["torch"] -class HubertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class HubertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) IBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class IBertForMaskedLM: +class IBertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class IBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class IBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class IBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class IBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class IBertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class IBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class IBertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class IBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class IBertModel(metaclass=DummyObject): + _backends = ["torch"] -class IBertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class IBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class IBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class ImageGPTForCausalImageModeling: +class ImageGPTForCausalImageModeling(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ImageGPTForImageClassification(metaclass=DummyObject): + _backends = ["torch"] -class ImageGPTForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class ImageGPTModel: +class ImageGPTModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ImageGPTPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class ImageGPTPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_imagegpt(*args, **kwargs): requires_backends(load_tf_weights_in_imagegpt, ["torch"]) @@ -2760,280 +1906,172 @@ def load_tf_weights_in_imagegpt(*args, **kwargs): LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = None -class LayoutLMForMaskedLM: +class LayoutLMForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMModel(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST = None -class LayoutLMv2ForQuestionAnswering: +class LayoutLMv2ForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMv2ForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMv2ForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMv2ForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMv2ForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMv2Model(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMv2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LayoutLMv2PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class LayoutLMv2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - LED_PRETRAINED_MODEL_ARCHIVE_LIST = None -class LEDForConditionalGeneration: +class LEDForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LEDForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class LEDForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LEDForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class LEDForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LEDModel(metaclass=DummyObject): + _backends = ["torch"] -class LEDModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LEDPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class LEDPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class LongformerForMaskedLM: +class LongformerForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LongformerForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class LongformerForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LongformerForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class LongformerForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LongformerForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class LongformerForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LongformerForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class LongformerForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LongformerModel(metaclass=DummyObject): + _backends = ["torch"] -class LongformerModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LongformerPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class LongformerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LongformerSelfAttention(metaclass=DummyObject): + _backends = ["torch"] -class LongformerSelfAttention: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -3041,109 +2079,93 @@ def __init__(self, *args, **kwargs): LUKE_PRETRAINED_MODEL_ARCHIVE_LIST = None -class LukeForEntityClassification: +class LukeForEntityClassification(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LukeForEntityPairClassification: +class LukeForEntityPairClassification(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LukeForEntitySpanClassification: +class LukeForEntitySpanClassification(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LukeForMaskedLM: +class LukeForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LukeModel(metaclass=DummyObject): + _backends = ["torch"] -class LukeModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LukePreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class LukePreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LxmertEncoder(metaclass=DummyObject): + _backends = ["torch"] -class LxmertEncoder: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LxmertForPreTraining: +class LxmertForPreTraining(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LxmertForQuestionAnswering: +class LxmertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LxmertModel(metaclass=DummyObject): + _backends = ["torch"] -class LxmertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LxmertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class LxmertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class LxmertVisualFeatureEncoder(metaclass=DummyObject): + _backends = ["torch"] -class LxmertVisualFeatureEncoder: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LxmertXLayer: +class LxmertXLayer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -3151,284 +2173,180 @@ def __init__(self, *args, **kwargs): M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST = None -class M2M100ForConditionalGeneration: +class M2M100ForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class M2M100Model(metaclass=DummyObject): + _backends = ["torch"] -class M2M100Model: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class M2M100PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class M2M100PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MarianForCausalLM(metaclass=DummyObject): + _backends = ["torch"] -class MarianForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MarianModel(metaclass=DummyObject): + _backends = ["torch"] -class MarianModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MarianMTModel(metaclass=DummyObject): + _backends = ["torch"] -class MarianMTModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MBartForCausalLM(metaclass=DummyObject): + _backends = ["torch"] -class MBartForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MBartForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class MBartForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MBartForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class MBartForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MBartForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class MBartForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MBartModel(metaclass=DummyObject): + _backends = ["torch"] -class MBartModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MBartPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class MBartPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class MegatronBertForCausalLM: +class MegatronBertForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertForNextSentencePrediction(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MegatronBertForQuestionAnswering: +class MegatronBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertModel(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MegatronBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class MegatronBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MMBTForClassification(metaclass=DummyObject): + _backends = ["torch"] -class MMBTForClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MMBTModel: +class MMBTModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ModalEmbeddings(metaclass=DummyObject): + _backends = ["torch"] -class ModalEmbeddings: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -3436,111 +2354,75 @@ def __init__(self, *args, **kwargs): MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class MobileBertForMaskedLM: +class MobileBertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MobileBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class MobileBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MobileBertForNextSentencePrediction(metaclass=DummyObject): + _backends = ["torch"] -class MobileBertForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MobileBertForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class MobileBertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MobileBertForQuestionAnswering: +class MobileBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MobileBertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class MobileBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MobileBertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class MobileBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MobileBertLayer(metaclass=DummyObject): + _backends = ["torch"] -class MobileBertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MobileBertModel: +class MobileBertModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MobileBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class MobileBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_mobilebert(*args, **kwargs): requires_backends(load_tf_weights_in_mobilebert, ["torch"]) @@ -3549,510 +2431,354 @@ def load_tf_weights_in_mobilebert(*args, **kwargs): MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = None -class MPNetForMaskedLM: +class MPNetForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MPNetForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class MPNetForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MPNetForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class MPNetForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MPNetForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class MPNetForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MPNetForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class MPNetForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MPNetLayer(metaclass=DummyObject): + _backends = ["torch"] -class MPNetLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class MPNetModel: +class MPNetModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MPNetPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class MPNetPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MT5EncoderModel(metaclass=DummyObject): + _backends = ["torch"] -class MT5EncoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MT5ForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class MT5ForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class MT5Model(metaclass=DummyObject): + _backends = ["torch"] -class MT5Model: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class NystromformerForMaskedLM: +class NystromformerForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class NystromformerForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class NystromformerForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class NystromformerForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class NystromformerForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class NystromformerForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class NystromformerForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class NystromformerForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class NystromformerForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class NystromformerLayer(metaclass=DummyObject): + _backends = ["torch"] -class NystromformerLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class NystromformerModel: +class NystromformerModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class NystromformerPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class NystromformerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class OpenAIGPTDoubleHeadsModel: +class OpenAIGPTDoubleHeadsModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class OpenAIGPTForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class OpenAIGPTForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class OpenAIGPTLMHeadModel(metaclass=DummyObject): + _backends = ["torch"] -class OpenAIGPTLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class OpenAIGPTModel(metaclass=DummyObject): + _backends = ["torch"] -class OpenAIGPTModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class OpenAIGPTPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class OpenAIGPTPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_openai_gpt(*args, **kwargs): requires_backends(load_tf_weights_in_openai_gpt, ["torch"]) -class PegasusForCausalLM: +class PegasusForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PegasusForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class PegasusForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PegasusModel(metaclass=DummyObject): + _backends = ["torch"] -class PegasusModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PegasusPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class PegasusPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class PerceiverForImageClassificationConvProcessing: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class PerceiverForImageClassificationConvProcessing(metaclass=DummyObject): + _backends = ["torch"] -class PerceiverForImageClassificationFourier: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class PerceiverForImageClassificationLearned: +class PerceiverForImageClassificationFourier(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class PerceiverForMaskedLM: +class PerceiverForImageClassificationLearned(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PerceiverForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class PerceiverForMultimodalAutoencoding: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class PerceiverForOpticalFlow: +class PerceiverForMultimodalAutoencoding(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class PerceiverForSequenceClassification: +class PerceiverForOpticalFlow(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PerceiverForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class PerceiverLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class PerceiverModel: +class PerceiverLayer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class PerceiverModel(metaclass=DummyObject): + _backends = ["torch"] -class PerceiverPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class PerceiverPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = None -class ProphetNetDecoder: +class ProphetNetDecoder(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class ProphetNetEncoder: +class ProphetNetEncoder(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class ProphetNetForCausalLM: +class ProphetNetForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ProphetNetForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class ProphetNetForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ProphetNetModel(metaclass=DummyObject): + _backends = ["torch"] -class ProphetNetModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ProphetNetPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class ProphetNetPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RagModel(metaclass=DummyObject): + _backends = ["torch"] -class RagModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RagPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class RagPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RagSequenceForGeneration(metaclass=DummyObject): + _backends = ["torch"] -class RagSequenceForGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class RagTokenForGeneration: +class RagTokenForGeneration(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -4060,191 +2786,127 @@ def __init__(self, *args, **kwargs): REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class ReformerAttention: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class ReformerAttention(metaclass=DummyObject): + _backends = ["torch"] -class ReformerForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ReformerForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class ReformerForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ReformerForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class ReformerForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ReformerForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class ReformerLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class ReformerModel: +class ReformerLayer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ReformerModel(metaclass=DummyObject): + _backends = ["torch"] -class ReformerModelWithLMHead: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ReformerModelWithLMHead(metaclass=DummyObject): + _backends = ["torch"] -class ReformerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class ReformerPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class RemBertForCausalLM: +class RemBertForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RemBertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class RemBertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RemBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class RemBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RemBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class RemBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RemBertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class RemBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RemBertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class RemBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RemBertLayer(metaclass=DummyObject): + _backends = ["torch"] -class RemBertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class RemBertModel: +class RemBertModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RemBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class RemBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_rembert(*args, **kwargs): requires_backends(load_tf_weights_in_rembert, ["torch"]) @@ -4253,232 +2915,144 @@ def load_tf_weights_in_rembert(*args, **kwargs): RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class RetriBertModel: +class RetriBertModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RetriBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class RetriBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class RobertaForCausalLM: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class RobertaForCausalLM(metaclass=DummyObject): + _backends = ["torch"] -class RobertaForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RobertaForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class RobertaForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RobertaForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class RobertaForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RobertaForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class RobertaForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RobertaForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class RobertaForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RobertaForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class RobertaModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RobertaModel(metaclass=DummyObject): + _backends = ["torch"] -class RobertaPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class RobertaPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class RoFormerForCausalLM: +class RoFormerForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RoFormerForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class RoFormerForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RoFormerForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class RoFormerForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RoFormerForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class RoFormerForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RoFormerForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class RoFormerForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RoFormerForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class RoFormerForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RoFormerLayer(metaclass=DummyObject): + _backends = ["torch"] -class RoFormerLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class RoFormerModel: +class RoFormerModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class RoFormerPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class RoFormerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_roformer(*args, **kwargs): requires_backends(load_tf_weights_in_roformer, ["torch"]) @@ -4487,399 +3061,275 @@ def load_tf_weights_in_roformer(*args, **kwargs): SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class SegformerDecodeHead: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class SegformerDecodeHead(metaclass=DummyObject): + _backends = ["torch"] -class SegformerForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class SegformerForSemanticSegmentation: +class SegformerForImageClassification(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class SegformerLayer: +class SegformerForSemanticSegmentation(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class SegformerModel: +class SegformerLayer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SegformerModel(metaclass=DummyObject): + _backends = ["torch"] -class SegformerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class SegformerPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) SEW_PRETRAINED_MODEL_ARCHIVE_LIST = None -class SEWForCTC: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class SEWForCTC(metaclass=DummyObject): + _backends = ["torch"] -class SEWForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SEWForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class SEWModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SEWModel(metaclass=DummyObject): + _backends = ["torch"] -class SEWPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class SEWPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST = None -class SEWDForCTC: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class SEWDForCTC(metaclass=DummyObject): + _backends = ["torch"] -class SEWDForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SEWDForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class SEWDModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SEWDModel(metaclass=DummyObject): + _backends = ["torch"] -class SEWDPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SEWDPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class SpeechEncoderDecoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class SpeechEncoderDecoderModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class Speech2TextForConditionalGeneration: +class Speech2TextForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class Speech2TextModel(metaclass=DummyObject): + _backends = ["torch"] -class Speech2TextModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class Speech2TextPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class Speech2TextPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class Speech2Text2ForCausalLM(metaclass=DummyObject): + _backends = ["torch"] -class Speech2Text2ForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class Speech2Text2PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class Speech2Text2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class SplinterForQuestionAnswering: +class SplinterForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SplinterLayer(metaclass=DummyObject): + _backends = ["torch"] -class SplinterLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class SplinterModel: +class SplinterModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SplinterPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class SplinterPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class SqueezeBertForMaskedLM: +class SqueezeBertForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SqueezeBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class SqueezeBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SqueezeBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class SqueezeBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SqueezeBertForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class SqueezeBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SqueezeBertForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class SqueezeBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SqueezeBertModel(metaclass=DummyObject): + _backends = ["torch"] -class SqueezeBertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class SqueezeBertModule(metaclass=DummyObject): + _backends = ["torch"] -class SqueezeBertModule: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class SqueezeBertPreTrainedModel: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) +class SqueezeBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] - def forward(self, *args, **kwargs): + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) T5_PRETRAINED_MODEL_ARCHIVE_LIST = None -class T5EncoderModel: +class T5EncoderModel(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class T5ForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class T5ForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class T5Model(metaclass=DummyObject): + _backends = ["torch"] -class T5Model: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class T5PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class T5PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_t5(*args, **kwargs): requires_backends(load_tf_weights_in_t5, ["torch"]) @@ -4888,56 +3338,38 @@ def load_tf_weights_in_t5(*args, **kwargs): TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None -class AdaptiveEmbedding: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class AdaptiveEmbedding(metaclass=DummyObject): + _backends = ["torch"] -class TransfoXLForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class TransfoXLForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class TransfoXLLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class TransfoXLLMHeadModel(metaclass=DummyObject): + _backends = ["torch"] -class TransfoXLModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class TransfoXLModel(metaclass=DummyObject): + _backends = ["torch"] -class TransfoXLPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class TransfoXLPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -4948,734 +3380,533 @@ def load_tf_weights_in_transfo_xl(*args, **kwargs): TROCR_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TrOCRForCausalLM: +class TrOCRForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class TrOCRPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class TrOCRPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST = None -class UniSpeechForCTC: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class UniSpeechForCTC(metaclass=DummyObject): + _backends = ["torch"] -class UniSpeechForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class UniSpeechForSequenceClassification: +class UniSpeechForPreTraining(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class UniSpeechForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class UniSpeechModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class UniSpeechModel(metaclass=DummyObject): + _backends = ["torch"] -class UniSpeechPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class UniSpeechPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class UniSpeechSatForAudioFrameClassification: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class UniSpeechSatForAudioFrameClassification(metaclass=DummyObject): + _backends = ["torch"] - -class UniSpeechSatForCTC: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class UniSpeechSatForPreTraining: +class UniSpeechSatForCTC(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class UniSpeechSatForSequenceClassification: +class UniSpeechSatForPreTraining(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class UniSpeechSatForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class UniSpeechSatForXVector: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class UniSpeechSatModel: +class UniSpeechSatForXVector(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class UniSpeechSatModel(metaclass=DummyObject): + _backends = ["torch"] -class UniSpeechSatPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class UniSpeechSatPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class VisionEncoderDecoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class VisionEncoderDecoderModel(metaclass=DummyObject): + _backends = ["torch"] -class VisionTextDualEncoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class VisionTextDualEncoderModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class VisualBertForMultipleChoice: +class VisualBertForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class VisualBertForPreTraining(metaclass=DummyObject): + _backends = ["torch"] -class VisualBertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class VisualBertForQuestionAnswering: +class VisualBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class VisualBertForRegionToPhraseAlignment(metaclass=DummyObject): + _backends = ["torch"] -class VisualBertForRegionToPhraseAlignment: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class VisualBertForVisualReasoning: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class VisualBertForVisualReasoning(metaclass=DummyObject): + _backends = ["torch"] -class VisualBertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class VisualBertModel: +class VisualBertLayer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class VisualBertModel(metaclass=DummyObject): + _backends = ["torch"] -class VisualBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class VisualBertPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) VIT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class ViTForImageClassification: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class ViTForImageClassification(metaclass=DummyObject): + _backends = ["torch"] -class ViTModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class ViTModel(metaclass=DummyObject): + _backends = ["torch"] -class ViTPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class ViTPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = None -class Wav2Vec2ForAudioFrameClassification: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class Wav2Vec2ForAudioFrameClassification(metaclass=DummyObject): + _backends = ["torch"] -class Wav2Vec2ForCTC: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class Wav2Vec2ForMaskedLM: +class Wav2Vec2ForCTC(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class Wav2Vec2ForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class Wav2Vec2ForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class Wav2Vec2ForSequenceClassification: +class Wav2Vec2ForPreTraining(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class Wav2Vec2ForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class Wav2Vec2ForXVector: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class Wav2Vec2Model: +class Wav2Vec2ForXVector(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class Wav2Vec2Model(metaclass=DummyObject): + _backends = ["torch"] -class Wav2Vec2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class Wav2Vec2PreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST = None -class WavLMForAudioFrameClassification: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - +class WavLMForAudioFrameClassification(metaclass=DummyObject): + _backends = ["torch"] -class WavLMForCTC: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class WavLMForSequenceClassification: +class WavLMForCTC(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class WavLMForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class WavLMForXVector: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class WavLMModel: +class WavLMForXVector(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class WavLMModel(metaclass=DummyObject): + _backends = ["torch"] -class WavLMPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class WavLMPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) XLM_PRETRAINED_MODEL_ARCHIVE_LIST = None -class XLMForMultipleChoice: +class XLMForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class XLMForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMForQuestionAnsweringSimple(metaclass=DummyObject): + _backends = ["torch"] -class XLMForQuestionAnsweringSimple: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class XLMForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class XLMForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMModel(metaclass=DummyObject): + _backends = ["torch"] -class XLMModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class XLMPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMWithLMHeadModel(metaclass=DummyObject): + _backends = ["torch"] -class XLMWithLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = None -class XLMProphetNetDecoder: - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMProphetNetDecoder(metaclass=DummyObject): + _backends = ["torch"] - -class XLMProphetNetEncoder: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class XLMProphetNetForCausalLM: +class XLMProphetNetEncoder(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMProphetNetForCausalLM(metaclass=DummyObject): + _backends = ["torch"] -class XLMProphetNetForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMProphetNetForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] -class XLMProphetNetModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - def forward(self, *args, **kwargs): +class XLMProphetNetModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class XLMRobertaForCausalLM: +class XLMRobertaForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMRobertaForMaskedLM(metaclass=DummyObject): + _backends = ["torch"] -class XLMRobertaForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMRobertaForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] -class XLMRobertaForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMRobertaForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class XLMRobertaForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMRobertaForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class XLMRobertaForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMRobertaForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class XLMRobertaForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLMRobertaModel(metaclass=DummyObject): + _backends = ["torch"] -class XLMRobertaModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = None -class XLNetForMultipleChoice: +class XLNetForMultipleChoice(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLNetForQuestionAnswering(metaclass=DummyObject): + _backends = ["torch"] -class XLNetForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLNetForQuestionAnsweringSimple(metaclass=DummyObject): + _backends = ["torch"] -class XLNetForQuestionAnsweringSimple: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLNetForSequenceClassification(metaclass=DummyObject): + _backends = ["torch"] -class XLNetForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLNetForTokenClassification(metaclass=DummyObject): + _backends = ["torch"] -class XLNetForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLNetLMHeadModel(metaclass=DummyObject): + _backends = ["torch"] -class XLNetLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLNetModel(metaclass=DummyObject): + _backends = ["torch"] -class XLNetModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) +class XLNetPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] -class XLNetPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["torch"]) - def load_tf_weights_in_xlnet(*args, **kwargs): requires_backends(load_tf_weights_in_xlnet, ["torch"]) -class Adafactor: +class Adafactor(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class AdamW: +class AdamW(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -5708,7 +3939,9 @@ def get_scheduler(*args, **kwargs): requires_backends(get_scheduler, ["torch"]) -class Trainer: +class Trainer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) @@ -5717,6 +3950,8 @@ def torch_distributed_zero_first(*args, **kwargs): requires_backends(torch_distributed_zero_first, ["torch"]) -class Seq2SeqTrainer: +class Seq2SeqTrainer(metaclass=DummyObject): + _backends = ["torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) diff --git a/src/transformers/utils/dummy_pytorch_quantization_and_torch_objects.py b/src/transformers/utils/dummy_pytorch_quantization_and_torch_objects.py index 9f036f9e1a3d5e..5612b769de1d32 100644 --- a/src/transformers/utils/dummy_pytorch_quantization_and_torch_objects.py +++ b/src/transformers/utils/dummy_pytorch_quantization_and_torch_objects.py @@ -1,122 +1,80 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class QDQBertForMaskedLM: +class QDQBertForMaskedLM(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertForMultipleChoice(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] -class QDQBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertForNextSentencePrediction(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] -class QDQBertForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] - -class QDQBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertForSequenceClassification(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] -class QDQBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertForTokenClassification(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] -class QDQBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertLayer(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] -class QDQBertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) -class QDQBertLMHeadModel: +class QDQBertLMHeadModel(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] + def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertModel(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] -class QDQBertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) +class QDQBertPreTrainedModel(metaclass=DummyObject): + _backends = ["pytorch_quantization", "torch"] -class QDQBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["pytorch_quantization", "torch"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["pytorch_quantization", "torch"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["pytorch_quantization", "torch"]) - def load_tf_weights_in_qdqbert(*args, **kwargs): requires_backends(load_tf_weights_in_qdqbert, ["pytorch_quantization", "torch"]) diff --git a/src/transformers/utils/dummy_scatter_objects.py b/src/transformers/utils/dummy_scatter_objects.py index 6a53b0f96354d7..abe9be04d154df 100644 --- a/src/transformers/utils/dummy_scatter_objects.py +++ b/src/transformers/utils/dummy_scatter_objects.py @@ -1,69 +1,45 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TapasForMaskedLM: +class TapasForMaskedLM(metaclass=DummyObject): + _backends = ["scatter"] + def __init__(self, *args, **kwargs): requires_backends(self, ["scatter"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["scatter"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["scatter"]) +class TapasForQuestionAnswering(metaclass=DummyObject): + _backends = ["scatter"] -class TapasForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["scatter"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["scatter"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["scatter"]) +class TapasForSequenceClassification(metaclass=DummyObject): + _backends = ["scatter"] -class TapasForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["scatter"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["scatter"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["scatter"]) +class TapasModel(metaclass=DummyObject): + _backends = ["scatter"] -class TapasModel: def __init__(self, *args, **kwargs): requires_backends(self, ["scatter"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["scatter"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["scatter"]) +class TapasPreTrainedModel(metaclass=DummyObject): + _backends = ["scatter"] -class TapasPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["scatter"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["scatter"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["scatter"]) - def load_tf_weights_in_tapas(*args, **kwargs): requires_backends(load_tf_weights_in_tapas, ["scatter"]) diff --git a/src/transformers/utils/dummy_sentencepiece_and_speech_objects.py b/src/transformers/utils/dummy_sentencepiece_and_speech_objects.py index 42727619d9a3c3..53e2502daba48e 100644 --- a/src/transformers/utils/dummy_sentencepiece_and_speech_objects.py +++ b/src/transformers/utils/dummy_sentencepiece_and_speech_objects.py @@ -1,11 +1,10 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class Speech2TextProcessor: +class Speech2TextProcessor(metaclass=DummyObject): + _backends = ["sentencepiece", "speech"] + def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece", "speech"]) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece", "speech"]) diff --git a/src/transformers/utils/dummy_sentencepiece_and_tokenizers_objects.py b/src/transformers/utils/dummy_sentencepiece_and_tokenizers_objects.py index 0cb93ec194f9d0..89efff7123f853 100644 --- a/src/transformers/utils/dummy_sentencepiece_and_tokenizers_objects.py +++ b/src/transformers/utils/dummy_sentencepiece_and_tokenizers_objects.py @@ -1,5 +1,6 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends SLOW_TO_FAST_CONVERTERS = None diff --git a/src/transformers/utils/dummy_sentencepiece_objects.py b/src/transformers/utils/dummy_sentencepiece_objects.py index 9bdc03411a1e72..90ad8a896710e1 100644 --- a/src/transformers/utils/dummy_sentencepiece_objects.py +++ b/src/transformers/utils/dummy_sentencepiece_objects.py @@ -1,200 +1,157 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class AlbertTokenizer: +class AlbertTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] + def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class BarthezTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class BarthezTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class BartphoTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class BartphoTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class BertGenerationTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class BertGenerationTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class BigBirdTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class BigBirdTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class CamembertTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class CamembertTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class DebertaV2Tokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class DebertaV2Tokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class LayoutXLMTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class LayoutXLMTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class M2M100Tokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class M2M100Tokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class MarianTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class MarianTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class MBart50Tokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class MBart50Tokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class MBartTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class MBartTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class MLukeTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class MLukeTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class MT5Tokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class MT5Tokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class PegasusTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class PegasusTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class ReformerTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class ReformerTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class RemBertTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class RemBertTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class Speech2TextTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class Speech2TextTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class T5Tokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class T5Tokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class XLMProphetNetTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class XLMProphetNetTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class XLMRobertaTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class XLMRobertaTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) +class XLNetTokenizer(metaclass=DummyObject): + _backends = ["sentencepiece"] -class XLNetTokenizer: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece"]) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["sentencepiece"]) diff --git a/src/transformers/utils/dummy_speech_objects.py b/src/transformers/utils/dummy_speech_objects.py index 9dd744f1997b9c..a1fd102aabc70a 100644 --- a/src/transformers/utils/dummy_speech_objects.py +++ b/src/transformers/utils/dummy_speech_objects.py @@ -1,7 +1,10 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class Speech2TextFeatureExtractor: +class Speech2TextFeatureExtractor(metaclass=DummyObject): + _backends = ["speech"] + def __init__(self, *args, **kwargs): requires_backends(self, ["speech"]) diff --git a/src/transformers/utils/dummy_tf_objects.py b/src/transformers/utils/dummy_tf_objects.py index 98bb7afbe9d3df..c099da8924f0ac 100644 --- a/src/transformers/utils/dummy_tf_objects.py +++ b/src/transformers/utils/dummy_tf_objects.py @@ -1,13 +1,18 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class TensorFlowBenchmarkArguments: +class TensorFlowBenchmarkArguments(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TensorFlowBenchmark: +class TensorFlowBenchmark(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) @@ -16,7 +21,9 @@ def tf_top_k_top_p_filtering(*args, **kwargs): requires_backends(tf_top_k_top_p_filtering, ["tf"]) -class PushToHubCallback: +class PushToHubCallback(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) @@ -24,89 +31,65 @@ def __init__(self, *args, **kwargs): TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFLayoutLMForMaskedLM: +class TFLayoutLMForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLayoutLMForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFLayoutLMForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLayoutLMForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFLayoutLMForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLayoutLMMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFLayoutLMMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFLayoutLMModel: +class TFLayoutLMModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLayoutLMPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFLayoutLMPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFSequenceSummary(metaclass=DummyObject): + _backends = ["tf"] -class TFSequenceSummary: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFSharedEmbeddings: +class TFSharedEmbeddings(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) @@ -118,99 +101,68 @@ def shape_list(*args, **kwargs): TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFAlbertForMaskedLM: +class TFAlbertForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAlbertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFAlbertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAlbertForPreTraining(metaclass=DummyObject): + _backends = ["tf"] -class TFAlbertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFAlbertForQuestionAnswering: +class TFAlbertForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAlbertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFAlbertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAlbertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFAlbertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAlbertMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFAlbertMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFAlbertModel: +class TFAlbertModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAlbertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFAlbertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_MODEL_FOR_CAUSAL_LM_MAPPING = None @@ -254,906 +206,561 @@ def call(self, *args, **kwargs): TF_MODEL_WITH_LM_HEAD_MAPPING = None -class TFAutoModel: +class TFAutoModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForCausalLM(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForCausalLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForImageClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForPreTraining(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForSeq2SeqLM(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForSeq2SeqLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForTableQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForTableQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelForVision2Seq(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelForVision2Seq: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAutoModelWithLMHead(metaclass=DummyObject): + _backends = ["tf"] -class TFAutoModelWithLMHead: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBartForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] -class TFBartForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBartModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBartModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBartPretrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBartPretrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFBertEmbeddings: - def __init__(self, *args, **kwargs): - requires_backends(self, ["tf"]) - +class TFBertEmbeddings(metaclass=DummyObject): + _backends = ["tf"] -class TFBertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] -class TFBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFBertForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertForNextSentencePrediction(metaclass=DummyObject): + _backends = ["tf"] -class TFBertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFBertForQuestionAnswering: +class TFBertForPreTraining(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFBertLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertLMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBertMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFBertModel: +class TFBertMainLayer(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBlenderbotForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBlenderbotForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] -class TFBlenderbotModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBlenderbotModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBlenderbotPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBlenderbotPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBlenderbotSmallForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBlenderbotSmallForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] -class TFBlenderbotSmallModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFBlenderbotSmallModel(metaclass=DummyObject): + _backends = ["tf"] -class TFBlenderbotSmallPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): +class TFBlenderbotSmallPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFCamembertForMaskedLM: +class TFCamembertForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCamembertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFCamembertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCamembertForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFCamembertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCamembertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFCamembertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCamembertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFCamembertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCamembertModel(metaclass=DummyObject): + _backends = ["tf"] -class TFCamembertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFCLIPModel: +class TFCLIPModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCLIPPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFCLIPPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCLIPTextModel(metaclass=DummyObject): + _backends = ["tf"] -class TFCLIPTextModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCLIPVisionModel(metaclass=DummyObject): + _backends = ["tf"] -class TFCLIPVisionModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFConvBertForMaskedLM: +class TFConvBertForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFConvBertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFConvBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFConvBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFConvBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFConvBertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFConvBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFConvBertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFConvBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFConvBertLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFConvBertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFConvBertModel: +class TFConvBertModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFConvBertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFConvBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFCTRLForSequenceClassification: +class TFCTRLForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCTRLLMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFCTRLLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCTRLModel(metaclass=DummyObject): + _backends = ["tf"] -class TFCTRLModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFCTRLPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFCTRLPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFDebertaForMaskedLM: +class TFDebertaForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaModel(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFDebertaV2ForMaskedLM: +class TFDebertaV2ForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaV2ForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaV2ForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaV2ForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaV2ForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaV2ForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaV2ForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaV2Model(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaV2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDebertaV2PreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFDebertaV2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFDistilBertForMaskedLM: +class TFDistilBertForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDistilBertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFDistilBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDistilBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFDistilBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDistilBertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFDistilBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDistilBertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFDistilBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDistilBertMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFDistilBertMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFDistilBertModel: +class TFDistilBertModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFDistilBertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFDistilBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None @@ -1164,32 +771,44 @@ def call(self, *args, **kwargs): TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFDPRContextEncoder: +class TFDPRContextEncoder(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFDPRPretrainedContextEncoder: +class TFDPRPretrainedContextEncoder(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFDPRPretrainedQuestionEncoder: +class TFDPRPretrainedQuestionEncoder(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFDPRPretrainedReader: +class TFDPRPretrainedReader(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFDPRQuestionEncoder: +class TFDPRQuestionEncoder(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFDPRReader: +class TFDPRReader(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) @@ -1197,522 +816,332 @@ def __init__(self, *args, **kwargs): TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFElectraForMaskedLM: +class TFElectraForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFElectraForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFElectraForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFElectraForPreTraining(metaclass=DummyObject): + _backends = ["tf"] -class TFElectraForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFElectraForQuestionAnswering: +class TFElectraForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFElectraForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFElectraForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFElectraForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFElectraForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFElectraModel(metaclass=DummyObject): + _backends = ["tf"] -class TFElectraModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFElectraPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFElectraPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFEncoderDecoderModel(metaclass=DummyObject): + _backends = ["tf"] -class TFEncoderDecoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFFlaubertForMultipleChoice: +class TFFlaubertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFlaubertForQuestionAnsweringSimple(metaclass=DummyObject): + _backends = ["tf"] -class TFFlaubertForQuestionAnsweringSimple: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFlaubertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFFlaubertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFlaubertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFFlaubertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFlaubertModel(metaclass=DummyObject): + _backends = ["tf"] -class TFFlaubertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFlaubertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFFlaubertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFlaubertWithLMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFFlaubertWithLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFFunnelBaseModel: +class TFFunnelBaseModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFunnelForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] -class TFFunnelForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFunnelForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFFunnelForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFunnelForPreTraining(metaclass=DummyObject): + _backends = ["tf"] -class TFFunnelForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFFunnelForQuestionAnswering: +class TFFunnelForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFunnelForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFFunnelForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFunnelForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFFunnelForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFunnelModel(metaclass=DummyObject): + _backends = ["tf"] -class TFFunnelModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFFunnelPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFFunnelPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFGPT2DoubleHeadsModel: +class TFGPT2DoubleHeadsModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFGPT2ForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFGPT2ForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFGPT2LMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFGPT2LMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFGPT2MainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFGPT2MainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFGPT2Model: +class TFGPT2Model(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFGPT2PreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFGPT2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFHubertForCTC: - def __init__(self, *args, **kwargs): - requires_backends(self, ["tf"]) - +class TFHubertForCTC(metaclass=DummyObject): + _backends = ["tf"] -class TFHubertModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFHubertModel(metaclass=DummyObject): + _backends = ["tf"] -class TFHubertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFHubertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFLEDForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLEDForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] -class TFLEDModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLEDModel(metaclass=DummyObject): + _backends = ["tf"] -class TFLEDPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): +class TFLEDPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFLongformerForMaskedLM: +class TFLongformerForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLongformerForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFLongformerForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLongformerForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFLongformerForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLongformerForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFLongformerForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLongformerForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] - -class TFLongformerForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLongformerModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFLongformerModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLongformerPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFLongformerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLongformerSelfAttention(metaclass=DummyObject): + _backends = ["tf"] -class TFLongformerSelfAttention: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) @@ -1720,488 +1149,326 @@ def __init__(self, *args, **kwargs): TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFLxmertForPreTraining: - def __init__(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLxmertForPreTraining(metaclass=DummyObject): + _backends = ["tf"] - -class TFLxmertMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFLxmertModel: +class TFLxmertMainLayer(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLxmertModel(metaclass=DummyObject): + _backends = ["tf"] -class TFLxmertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFLxmertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFLxmertVisualFeatureEncoder: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFMarianModel: +class TFLxmertVisualFeatureEncoder(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMarianModel(metaclass=DummyObject): + _backends = ["tf"] -class TFMarianMTModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMarianMTModel(metaclass=DummyObject): + _backends = ["tf"] -class TFMarianPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMarianPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFMBartForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMBartForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] -class TFMBartModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMBartModel(metaclass=DummyObject): + _backends = ["tf"] -class TFMBartPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): +class TFMBartPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFMobileBertForMaskedLM: +class TFMobileBertForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMobileBertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFMobileBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMobileBertForNextSentencePrediction(metaclass=DummyObject): + _backends = ["tf"] -class TFMobileBertForNextSentencePrediction: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMobileBertForPreTraining(metaclass=DummyObject): + _backends = ["tf"] -class TFMobileBertForPreTraining: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFMobileBertForQuestionAnswering: +class TFMobileBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMobileBertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFMobileBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMobileBertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFMobileBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMobileBertMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFMobileBertMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFMobileBertModel: +class TFMobileBertModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMobileBertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFMobileBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFMPNetForMaskedLM: +class TFMPNetForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMPNetForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFMPNetForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMPNetForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFMPNetForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMPNetForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] - -class TFMPNetForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMPNetForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] - -class TFMPNetForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMPNetMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFMPNetMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFMPNetModel: +class TFMPNetModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMPNetPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFMPNetPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMT5EncoderModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFMT5EncoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMT5ForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] - -class TFMT5ForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFMT5Model(metaclass=DummyObject): + _backends = ["tf"] -class TFMT5Model: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFOpenAIGPTDoubleHeadsModel: +class TFOpenAIGPTDoubleHeadsModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFOpenAIGPTForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFOpenAIGPTForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFOpenAIGPTLMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFOpenAIGPTLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFOpenAIGPTMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFOpenAIGPTMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFOpenAIGPTModel: +class TFOpenAIGPTModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFOpenAIGPTPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFOpenAIGPTPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFPegasusForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] -class TFPegasusForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFPegasusModel(metaclass=DummyObject): + _backends = ["tf"] -class TFPegasusModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFPegasusPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFPegasusPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRagModel(metaclass=DummyObject): + _backends = ["tf"] -class TFRagModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRagPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFRagPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRagSequenceForGeneration(metaclass=DummyObject): + _backends = ["tf"] - -class TFRagSequenceForGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFRagTokenForGeneration: +class TFRagTokenForGeneration(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) @@ -2209,833 +1476,547 @@ def __init__(self, *args, **kwargs): TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFRemBertForCausalLM: +class TFRemBertForCausalLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRemBertForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] -class TFRemBertForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRemBertForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFRemBertForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRemBertForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFRemBertForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRemBertForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFRemBertForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRemBertForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFRemBertForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRemBertLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFRemBertLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFRemBertModel: +class TFRemBertModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRemBertPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFRemBertPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFRobertaForCausalLM: +class TFRobertaForCausalLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRobertaForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] -class TFRobertaForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRobertaForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] - -class TFRobertaForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRobertaForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] - -class TFRobertaForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRobertaForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFRobertaForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRobertaForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFRobertaForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRobertaMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFRobertaMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFRobertaModel: +class TFRobertaModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRobertaPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFRobertaPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFRoFormerForCausalLM: +class TFRoFormerForCausalLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRoFormerForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] -class TFRoFormerForMaskedLM: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRoFormerForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] -class TFRoFormerForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRoFormerForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFRoFormerForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRoFormerForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFRoFormerForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRoFormerForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFRoFormerForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRoFormerLayer(metaclass=DummyObject): + _backends = ["tf"] - -class TFRoFormerLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFRoFormerModel: +class TFRoFormerModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFRoFormerPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFRoFormerPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFT5EncoderModel: +class TFT5EncoderModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFT5ForConditionalGeneration(metaclass=DummyObject): + _backends = ["tf"] - -class TFT5ForConditionalGeneration: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFT5Model(metaclass=DummyObject): + _backends = ["tf"] - -class TFT5Model: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFT5PreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFT5PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFTapasForMaskedLM: +class TFTapasForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTapasForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFTapasForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTapasForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFTapasForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTapasModel(metaclass=DummyObject): + _backends = ["tf"] -class TFTapasModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTapasPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFTapasPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFAdaptiveEmbedding: - def __init__(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFAdaptiveEmbedding(metaclass=DummyObject): + _backends = ["tf"] - -class TFTransfoXLForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTransfoXLForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFTransfoXLLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTransfoXLLMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFTransfoXLMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFTransfoXLModel: +class TFTransfoXLMainLayer(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTransfoXLModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFTransfoXLPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFTransfoXLPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFVisionEncoderDecoderModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFVisionEncoderDecoderModel(metaclass=DummyObject): + _backends = ["tf"] -class TFViTForImageClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFViTModel: +class TFViTForImageClassification(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFViTModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFViTPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): +class TFViTPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFWav2Vec2ForCTC: - def __init__(self, *args, **kwargs): - requires_backends(self, ["tf"]) - +class TFWav2Vec2ForCTC(metaclass=DummyObject): + _backends = ["tf"] -class TFWav2Vec2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFWav2Vec2Model(metaclass=DummyObject): + _backends = ["tf"] -class TFWav2Vec2PreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): +class TFWav2Vec2PreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] + + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFXLMForMultipleChoice: +class TFXLMForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMForQuestionAnsweringSimple(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMForQuestionAnsweringSimple: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMMainLayer(metaclass=DummyObject): + _backends = ["tf"] - -class TFXLMMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFXLMModel: +class TFXLMModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMWithLMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMWithLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFXLMRobertaForMaskedLM: +class TFXLMRobertaForMaskedLM(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMRobertaForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] - -class TFXLMRobertaForMultipleChoice: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMRobertaForQuestionAnswering(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMRobertaForQuestionAnswering: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMRobertaForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMRobertaForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMRobertaForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMRobertaForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLMRobertaModel(metaclass=DummyObject): + _backends = ["tf"] -class TFXLMRobertaModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) - TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = None -class TFXLNetForMultipleChoice: +class TFXLNetForMultipleChoice(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLNetForQuestionAnsweringSimple(metaclass=DummyObject): + _backends = ["tf"] -class TFXLNetForQuestionAnsweringSimple: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLNetForSequenceClassification(metaclass=DummyObject): + _backends = ["tf"] - -class TFXLNetForSequenceClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLNetForTokenClassification(metaclass=DummyObject): + _backends = ["tf"] - -class TFXLNetForTokenClassification: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLNetLMHeadModel(metaclass=DummyObject): + _backends = ["tf"] -class TFXLNetLMHeadModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLNetMainLayer(metaclass=DummyObject): + _backends = ["tf"] -class TFXLNetMainLayer: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class TFXLNetModel: +class TFXLNetModel(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class TFXLNetPreTrainedModel(metaclass=DummyObject): + _backends = ["tf"] - -class TFXLNetPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tf"]) - def call(self, *args, **kwargs): - requires_backends(self, ["tf"]) +class AdamWeightDecay(metaclass=DummyObject): + _backends = ["tf"] - -class AdamWeightDecay: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class GradientAccumulator: +class GradientAccumulator(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -class WarmUp: +class WarmUp(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) @@ -3044,6 +2025,8 @@ def create_optimizer(*args, **kwargs): requires_backends(create_optimizer, ["tf"]) -class TFTrainer: +class TFTrainer(metaclass=DummyObject): + _backends = ["tf"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) diff --git a/src/transformers/utils/dummy_timm_and_vision_objects.py b/src/transformers/utils/dummy_timm_and_vision_objects.py index baa0563cc2e610..86badb87460036 100644 --- a/src/transformers/utils/dummy_timm_and_vision_objects.py +++ b/src/transformers/utils/dummy_timm_and_vision_objects.py @@ -1,53 +1,34 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None -class DetrForObjectDetection: +class DetrForObjectDetection(metaclass=DummyObject): + _backends = ["timm", "vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["timm", "vision"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["timm", "vision"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["timm", "vision"]) +class DetrForSegmentation(metaclass=DummyObject): + _backends = ["timm", "vision"] -class DetrForSegmentation: def __init__(self, *args, **kwargs): requires_backends(self, ["timm", "vision"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["timm", "vision"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["timm", "vision"]) +class DetrModel(metaclass=DummyObject): + _backends = ["timm", "vision"] -class DetrModel: def __init__(self, *args, **kwargs): requires_backends(self, ["timm", "vision"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["timm", "vision"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["timm", "vision"]) +class DetrPreTrainedModel(metaclass=DummyObject): + _backends = ["timm", "vision"] -class DetrPreTrainedModel: def __init__(self, *args, **kwargs): requires_backends(self, ["timm", "vision"]) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["timm", "vision"]) - - def forward(self, *args, **kwargs): - requires_backends(self, ["timm", "vision"]) diff --git a/src/transformers/utils/dummy_tokenizers_objects.py b/src/transformers/utils/dummy_tokenizers_objects.py index d641b49ead19aa..28897493ce56ab 100644 --- a/src/transformers/utils/dummy_tokenizers_objects.py +++ b/src/transformers/utils/dummy_tokenizers_objects.py @@ -1,398 +1,311 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class AlbertTokenizerFast: +class AlbertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] + def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class BartTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class BartTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class BarthezTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class BarthezTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class BertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class BertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class BigBirdTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class BigBirdTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class BlenderbotTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class BlenderbotTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class BlenderbotSmallTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class BlenderbotSmallTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class CamembertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class CamembertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class CLIPTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class CLIPTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class ConvBertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class ConvBertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class DebertaTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class DebertaTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class DistilBertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class DistilBertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class DPRContextEncoderTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class DPRContextEncoderTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class DPRQuestionEncoderTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class DPRQuestionEncoderTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class DPRReaderTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class DPRReaderTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class ElectraTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class ElectraTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class FNetTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class FNetTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class FunnelTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class FunnelTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class GPT2TokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class GPT2TokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class HerbertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class HerbertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class LayoutLMTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class LayoutLMTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class LayoutLMv2TokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class LayoutLMv2TokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class LayoutXLMTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class LayoutXLMTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class LEDTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class LEDTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class LongformerTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class LongformerTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class LxmertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class LxmertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class MBartTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class MBartTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class MBart50TokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class MBart50TokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class MobileBertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class MobileBertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class MPNetTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class MPNetTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class MT5TokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class MT5TokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class OpenAIGPTTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class OpenAIGPTTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class PegasusTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class PegasusTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class ReformerTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class ReformerTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class RemBertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class RemBertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class RetriBertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class RetriBertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class RobertaTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class RobertaTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class RoFormerTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class RoFormerTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class SplinterTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class SplinterTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class SqueezeBertTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class SqueezeBertTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class T5TokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class T5TokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class XLMRobertaTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class XLMRobertaTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class XLNetTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class XLNetTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) +class PreTrainedTokenizerFast(metaclass=DummyObject): + _backends = ["tokenizers"] -class PreTrainedTokenizerFast: def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["tokenizers"]) diff --git a/src/transformers/utils/dummy_vision_objects.py b/src/transformers/utils/dummy_vision_objects.py index 53477576247386..b7408bf3db2849 100644 --- a/src/transformers/utils/dummy_vision_objects.py +++ b/src/transformers/utils/dummy_vision_objects.py @@ -1,79 +1,94 @@ # This file is autogenerated by the command `make fix-copies`, do not edit. -from ..file_utils import requires_backends +# flake8: noqa +from ..file_utils import DummyObject, requires_backends -class ImageFeatureExtractionMixin: +class ImageFeatureExtractionMixin(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class BeitFeatureExtractor: +class BeitFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class CLIPFeatureExtractor: +class CLIPFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class CLIPProcessor: +class CLIPProcessor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["vision"]) +class DeiTFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] -class DeiTFeatureExtractor: def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class DetrFeatureExtractor: +class DetrFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class ImageGPTFeatureExtractor: +class ImageGPTFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class LayoutLMv2FeatureExtractor: +class LayoutLMv2FeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class LayoutLMv2Processor: +class LayoutLMv2Processor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["vision"]) +class LayoutXLMProcessor(metaclass=DummyObject): + _backends = ["vision"] -class LayoutXLMProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, ["vision"]) +class PerceiverFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] -class PerceiverFeatureExtractor: def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class SegformerFeatureExtractor: +class SegformerFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) -class ViTFeatureExtractor: +class ViTFeatureExtractor(metaclass=DummyObject): + _backends = ["vision"] + def __init__(self, *args, **kwargs): requires_backends(self, ["vision"]) diff --git a/utils/check_dummies.py b/utils/check_dummies.py index 2084b32f13a00c..e082b4b8599c6d 100644 --- a/utils/check_dummies.py +++ b/utils/check_dummies.py @@ -33,46 +33,15 @@ {0} = None """ -DUMMY_PRETRAINED_CLASS = """ -class {0}: - def __init__(self, *args, **kwargs): - requires_backends(self, {1}) - - @classmethod - def from_pretrained(cls, *args, **kwargs): - requires_backends(cls, {1}) -""" - -PT_DUMMY_PRETRAINED_CLASS = ( - DUMMY_PRETRAINED_CLASS - + """ - def forward(self, *args, **kwargs): - requires_backends(self, {1}) -""" -) - -TF_DUMMY_PRETRAINED_CLASS = ( - DUMMY_PRETRAINED_CLASS - + """ - def call(self, *args, **kwargs): - requires_backends(self, {1}) -""" -) - -FLAX_DUMMY_PRETRAINED_CLASS = ( - DUMMY_PRETRAINED_CLASS - + """ - def __call__(self, *args, **kwargs): - requires_backends(self, {1}) -""" -) - DUMMY_CLASS = """ -class {0}: +class {0}(metaclass=DummyObject): + _backends = {1} + def __init__(self, *args, **kwargs): requires_backends(self, {1}) """ + DUMMY_FUNCTION = """ def {0}(*args, **kwargs): requires_backends({0}, {1}) @@ -126,45 +95,12 @@ def read_init(): def create_dummy_object(name, backend_name): """Create the code for the dummy object corresponding to `name`.""" - _models = [ - "ForCausalLM", - "ForConditionalGeneration", - "ForMaskedLM", - "ForMultipleChoice", - "ForNextSentencePrediction", - "ForObjectDetection", - "ForQuestionAnswering", - "ForSegmentation", - "ForSequenceClassification", - "ForTokenClassification", - "Model", - ] - _pretrained = ["Config", "Tokenizer", "Processor"] if name.isupper(): return DUMMY_CONSTANT.format(name) elif name.islower(): return DUMMY_FUNCTION.format(name, backend_name) else: - is_model = False - for part in _models: - if part in name: - is_model = True - break - if is_model: - if name.startswith("TF"): - return TF_DUMMY_PRETRAINED_CLASS.format(name, backend_name) - if name.startswith("Flax"): - return FLAX_DUMMY_PRETRAINED_CLASS.format(name, backend_name) - return PT_DUMMY_PRETRAINED_CLASS.format(name, backend_name) - is_pretrained = False - for part in _pretrained: - if part in name: - is_pretrained = True - break - if is_pretrained: - return DUMMY_PRETRAINED_CLASS.format(name, backend_name) - else: - return DUMMY_CLASS.format(name, backend_name) + return DUMMY_CLASS.format(name, backend_name) def create_dummy_files(): @@ -176,7 +112,8 @@ def create_dummy_files(): for backend, objects in backend_specific_objects.items(): backend_name = "[" + ", ".join(f'"{b}"' for b in backend.split("_and_")) + "]" dummy_file = "# This file is autogenerated by the command `make fix-copies`, do not edit.\n" - dummy_file += "from ..file_utils import requires_backends\n\n" + dummy_file += "# flake8: noqa\n" + dummy_file += "from ..file_utils import DummyObject, requires_backends\n\n" dummy_file += "\n".join([create_dummy_object(o, backend_name) for o in objects]) dummy_files[backend] = dummy_file diff --git a/utils/check_repo.py b/utils/check_repo.py index d15fc88801bad7..0f1e624f470a15 100644 --- a/utils/check_repo.py +++ b/utils/check_repo.py @@ -522,6 +522,7 @@ def find_all_documented_objects(): "BasicTokenizer", # Internal, should never have been in the main init. "CharacterTokenizer", # Internal, should never have been in the main init. "DPRPretrainedReader", # Like an Encoder. + "DummyObject", # Just picked by mistake sometimes. "MecabTokenizer", # Internal, should never have been in the main init. "ModelCard", # Internal type. "SqueezeBertModule", # Internal building block (should have been called SqueezeBertLayer)