




"""simple docstring"""

import abc
import copy
import dataclasses
from dataclasses import dataclass
from typing import ClassVar, Dict, Type, TypeVar

from ..features import Features


__A							=     TypeVar("T", bound="TaskTemplate")
@dataclass(frozen=lowerCamelCase_     )
class      lowerCamelCase__      (					abc.ABC     ):
			# `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
			a__	: str
			a__	: ClassVar[Features]
			a__	: ClassVar[Features]


			def 							lowerCamelCase_			(       self			,	SCREAMING_SNAKE_CASE							):



					"""simple docstring"""







					return copy.deepcopy(self							)


			@property
			def 							lowerCamelCase_			(       self							):



					"""simple docstring"""







					return Features(**self.input_schema			,	**self.label_schema							)


			@property
			@abc.abstractmethod
			def 							lowerCamelCase_			(       self							):



					"""simple docstring"""







					raise NotImplementedError



			@classmethod
			def 							lowerCamelCase_			(       cls			,	SCREAMING_SNAKE_CASE							):



					"""simple docstring"""







					snake_case						:  Optional[int]        =			{f.name for f in dataclasses.fields(cls							)}
					return cls(**{k: v for k, v in template_dict.items() if k in field_names}							)







"""simple docstring"""

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__A							=     {
    "configuration_flava": [
        "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "FlavaConfig",
        "FlavaImageCodebookConfig",
        "FlavaImageConfig",
        "FlavaMultimodalConfig",
        "FlavaTextConfig",
    ],
}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__A							=     ["FlavaFeatureExtractor"]
							__A							=     ["FlavaImageProcessor"]
							__A							=     ["FlavaProcessor"]

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__A							=     [
							    "FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "FlavaForPreTraining",
							    "FlavaImageCodebook",
							    "FlavaImageModel",
							    "FlavaModel",
							    "FlavaMultimodalModel",
							    "FlavaPreTrainedModel",
							    "FlavaTextModel",
							]

if TYPE_CHECKING:
							from .configuration_flava import (
							    FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    FlavaConfig,
							    FlavaImageCodebookConfig,
							    FlavaImageConfig,
							    FlavaMultimodalConfig,
							    FlavaTextConfig,
							)

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_flava import FlavaFeatureExtractor
														from .image_processing_flava import FlavaImageProcessor
														from .processing_flava import FlavaProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_flava import (
														    FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    FlavaForPreTraining,
														    FlavaImageCodebook,
														    FlavaImageModel,
														    FlavaModel,
														    FlavaMultimodalModel,
														    FlavaPreTrainedModel,
														    FlavaTextModel,
														)

else:
							import sys

							__A							=     _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

