






"""simple docstring"""





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

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


@dataclass(frozen=A_						)
class      _lowercase (     A_						):
      _a   :     str								=   field(default='''automatic-speech-recognition'''		,  metadata={'''include_in_asdict_even_if_is_default''': True}						)
      _a   :     ClassVar[Features]								=   Features({'''audio''': Audio()}						)
      _a   :     ClassVar[Features]								=   Features({'''transcription''': Value('''string'''						)}						)
      _a   :     str								=   "audio"
      _a   :     str								=   "transcription"


      def _UpperCamelCase						(    self				:	Tuple							,   a				:	str						):





            """simple docstring"""







            if self.audio_column not in features:
                  raise ValueError(f'''Column {self.audio_column} is not present in features.'''						)
            if not isinstance(features[self.audio_column]							,   a						):
                  raise ValueError(f'''Column {self.audio_column} is not an Audio type.'''						)
            __snake_case      :    int  			=copy.deepcopy(self						)
            __snake_case      :    Tuple  			=self.input_schema.copy()
            __snake_case      :    Tuple  			=features[self.audio_column]
            __snake_case      :    List[str]  			=input_schema
            return task_template







      @property
      def _UpperCamelCase						(    self				:	List[Any]						):





            """simple docstring"""







            return {self.audio_column: "audio", self.transcription_column: "transcription"}










"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


UpperCamelCase_	:				str										= {"""processing_layoutxlm""": ["""LayoutXLMProcessor"""]}

try:
    if not is_sentencepiece_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCamelCase_	:				Union[str, Any]										= ["""LayoutXLMTokenizer"""]

try:
    if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCamelCase_	:				Optional[int]										= ["""LayoutXLMTokenizerFast"""]

if TYPE_CHECKING:
    from .processing_layoutxlm import LayoutXLMProcessor

    try:
        if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_layoutxlm import LayoutXLMTokenizer

    try:
        if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_layoutxlm_fast import LayoutXLMTokenizerFast

else:
    import sys

    UpperCamelCase_	:				List[Any]										= _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


