


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tokenizers_available


A_    :					List[Any]             ={}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A_    :					Optional[Any]             =["""CpmTokenizer"""]

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A_    :					List[Any]             =["""CpmTokenizerFast"""]


if TYPE_CHECKING:
	try:
		if not is_sentencepiece_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_cpm import CpmTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_cpm_fast import CpmTokenizerFast

else:
	import sys

	A_    :					Optional[Any]             =_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_    :					Tuple             =TypeVar("""T""", bound="""TaskTemplate""")





@dataclass(frozen=UpperCamelCase__)
class        lowercase_				( abc.ABC):






							"""simple docstring"""







							snake_case_        =		42
							snake_case_        =		42
							snake_case_        =		42


							def 						lowercase__     (   self			,    _UpperCAmelCase		):







													"""simple docstring"""


													return copy.deepcopy(self		)


							@property
							def 						lowercase__     (   self		):







													"""simple docstring"""


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


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







													"""simple docstring"""


													raise NotImplementedError






							@classmethod
							def 						lowercase__     (   cls			,    _UpperCAmelCase		):







													"""simple docstring"""


													a_					=		{f.name for f in dataclasses.fields(cls		)}
													return cls(**{k: v for k, v in template_dict.items() if k in field_names}		)