





'''simple docstring'''


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

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






@dataclass(frozen=__UpperCAmelCase     )
class       UpperCamelCase__  (		__UpperCAmelCase     ):
	lowerCAmelCase__					:			str								=						field(default="text-classification"	,metadata={"include_in_asdict_even_if_is_default": True}     )
	lowerCAmelCase__					:			ClassVar[Features]								=						Features({"text": Value("string"     )}     )
	lowerCAmelCase__					:			ClassVar[Features]								=						Features({"labels": ClassLabel}     )
	lowerCAmelCase__					:			str								=						"text"
	lowerCAmelCase__					:			str								=						"labels"







	def 						__a   (				self			:   int , lowerCamelCase			:   int		):




				'''simple docstring'''
				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] , UpperCAmelCase_		):
							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 						__a   (				self			:   Any		):




				'''simple docstring'''
				return {
				    self.text_column: "text",
				    self.label_column: "labels",
				}










'''simple docstring'''


import unittest

from accelerate import debug_launcher
from accelerate.test_utils import require_cpu, test_ops, test_script






@require_cpu
class       UpperCamelCase__  (		unittest.TestCase     ):







	def 						__a   (				self			:   List[str]		):




				'''simple docstring'''
				debug_launcher(test_script.main		)







	def 						__a   (				self			:   Dict		):




				'''simple docstring'''
				debug_launcher(test_ops.main		)



