
from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE							:List[str]										=    {'configuration_yolos': ['YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP', 'YolosConfig', 'YolosOnnxConfig']}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE							:int										=    ['YolosFeatureExtractor']
					SCREAMING_SNAKE_CASE							:Optional[int]										=    ['YolosImageProcessor']

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE							:Optional[Any]										=    [
					    'YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST',
					    'YolosForObjectDetection',
					    'YolosModel',
					    'YolosPreTrainedModel',
					]


if TYPE_CHECKING:
					from .configuration_yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig, YolosOnnxConfig

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_yolos import YolosFeatureExtractor
										from .image_processing_yolos import YolosImageProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_yolos import (
										    YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST,
										    YolosForObjectDetection,
										    YolosModel,
										    YolosPreTrainedModel,
										)


else:
					import sys

					SCREAMING_SNAKE_CASE							:Optional[int]										=    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import ClassLabel, Features, Value
from .base import TaskTemplate





@dataclass(frozen=__SCREAMING_SNAKE_CASE  )
class 							UpperCAmelCase				(  __SCREAMING_SNAKE_CASE  ):




	'''simple docstring'''





	snake_case_    =					field(default="text-classification"      ,      metadata={"include_in_asdict_even_if_is_default": True}  )
	snake_case_    =					Features({"text": Value("string"  )}  )
	snake_case_    =					Features({"labels": ClassLabel}  )
	snake_case_    =					"text"
	snake_case_    =					"labels"






	def     UpperCamelCase_  (	self :			Optional[Any]							,A :			Dict			):
					if self.label_column not in features:
									raise ValueError(f'''Column {self.label_column} is not present in features.'''			)
					if not isinstance(features[self.label_column]							,A			):
									raise ValueError(f'''Column {self.label_column} is not a ClassLabel.'''			)
					__A             =			copy.deepcopy(self			)
					__A             =			self.label_schema.copy()
					__A             =			features[self.label_column]
					__A             =			label_schema
					return task_template







	@property
	def     UpperCamelCase_  (	self :			Dict			):
					return {
					    self.text_column: "text",
					    self.label_column: "labels",
					}
