



from typing import Optional

from ..utils.logging import get_logger
from .audio_classificiation import AudioClassification
from .automatic_speech_recognition import AutomaticSpeechRecognition
from .base import TaskTemplate
from .image_classification import ImageClassification
from .language_modeling import LanguageModeling
from .question_answering import QuestionAnsweringExtractive
from .summarization import Summarization
from .text_classification import TextClassification


UpperCamelCase_      			=  [
    "AutomaticSpeechRecognition",
    "AudioClassification",
    "ImageClassification",
    "LanguageModeling",
    "QuestionAnsweringExtractive",
    "Summarization",
    "TaskTemplate",
    "TextClassification",
]

UpperCamelCase_      			=  get_logger(__name__)


UpperCamelCase_      			=  {
    AutomaticSpeechRecognition.task: AutomaticSpeechRecognition,
    AudioClassification.task: AudioClassification,
    ImageClassification.task: ImageClassification,
    LanguageModeling.task: LanguageModeling,
    QuestionAnsweringExtractive.task: QuestionAnsweringExtractive,
    Summarization.task: Summarization,
    TextClassification.task: TextClassification,
}







def 							A     (						__UpperCAmelCase      )			->			Optional[TaskTemplate]:



						'''simple docstring'''






						UpperCAmelCase_					=	task_template_dict.get('''task'''      )
						if task_name is None:
												logger.warning(f"Couldn't find template for task '{task_name}'. Available templates: {list(lowerCAmelCase_      )}"      )
												return None
						UpperCAmelCase_					=	NAMEaTEMPLATE.get(lowerCAmelCase_      )
						return template.from_dict(lowerCAmelCase_      )






from ..utils import DummyObject, requires_backends





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)