
from typing import TYPE_CHECKING

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


A         =    {'''configuration_levit''': ['''LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''LevitConfig''', '''LevitOnnxConfig''']}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A         =    ['''LevitFeatureExtractor''']
		A         =    ['''LevitImageProcessor''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A         =    [
		    '''LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''LevitForImageClassification''',
		    '''LevitForImageClassificationWithTeacher''',
		    '''LevitModel''',
		    '''LevitPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_levit import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, LevitConfig, LevitOnnxConfig

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_levit import LevitFeatureExtractor
				from .image_processing_levit import LevitImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_levit import (
				    LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    LevitForImageClassification,
				    LevitForImageClassificationWithTeacher,
				    LevitModel,
				    LevitPreTrainedModel,
				)
else:
		import sys

		A         =    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

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

from ..features import Features


A		:   Optional[int]         =    TypeVar('''T''', bound='''TaskTemplate''')



@dataclass(frozen=_a						)
class       a_   ( 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       UpperCamelCase_							(			self							, __UpperCamelCase     ):
									return copy.deepcopy(self     )






			@property
			def       UpperCamelCase_							(			self     ):
									return Features(**self.input_schema							, **self.label_schema     )






			@property
			@abc.abstractmethod
			def       UpperCamelCase_							(			self     ):
									raise NotImplementedError






			@classmethod
			def       UpperCamelCase_							(			cls							, __UpperCamelCase     ):
									_lowercase									=				{f.name for f in dataclasses.fields(cls     )}
									return cls(**{k: v for k, v in template_dict.items() if k in field_names}     )