
'''simple docstring'''

import os
import sys

__snake_case:  Any								=			os.path.join(os.path.dirname(__file__), "src")
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


__snake_case:  Any								=			[
    "torch",
    "numpy",
    "tokenizers",
    "filelock",
    "requests",
    "tqdm",
    "regex",
    "sentencepiece",
    "sacremoses",
    "importlib_metadata",
    "huggingface_hub",
]






@add_start_docstrings(AutoConfig.__doc__   )
def 	_snake_case						(      *A_       :    List[Any]     ,		**A_       :    Optional[int]   ):
  """simple docstring"""







  return AutoConfig.from_pretrained(*A_     ,		**A_   )






@add_start_docstrings(AutoTokenizer.__doc__   )
def 	_snake_case						(      *A_       :    int     ,		**A_       :    Tuple   ):
  """simple docstring"""







  return AutoTokenizer.from_pretrained(*A_     ,		**A_   )






@add_start_docstrings(AutoModel.__doc__   )
def 	_snake_case						(      *A_       :    Optional[Any]     ,		**A_       :    Optional[int]   ):
  """simple docstring"""







  return AutoModel.from_pretrained(*A_     ,		**A_   )






@add_start_docstrings(AutoModelForCausalLM.__doc__   )
def 	_snake_case						(      *A_       :    Tuple     ,		**A_       :    int   ):
  """simple docstring"""







  return AutoModelForCausalLM.from_pretrained(*A_     ,		**A_   )






@add_start_docstrings(AutoModelForMaskedLM.__doc__   )
def 	_snake_case						(      *A_       :    int     ,		**A_       :    int   ):
  """simple docstring"""







  return AutoModelForMaskedLM.from_pretrained(*A_     ,		**A_   )






@add_start_docstrings(AutoModelForSequenceClassification.__doc__   )
def 	_snake_case						(      *A_       :    int     ,		**A_       :    Optional[int]   ):
  """simple docstring"""







  return AutoModelForSequenceClassification.from_pretrained(*A_     ,		**A_   )






@add_start_docstrings(AutoModelForQuestionAnswering.__doc__   )
def 	_snake_case						(      *A_       :    Dict     ,		**A_       :    List[Any]   ):
  """simple docstring"""







  return AutoModelForQuestionAnswering.from_pretrained(*A_     ,		**A_   )




'''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=lowerCAmelCase__    )
class  _UpperCAmelCase ( lowerCAmelCase__    ):

     """simple docstring"""

     a_    	=					field(default="automatic-speech-recognition"	,metadata={"include_in_asdict_even_if_is_default": True}    )
     a_    	=					Features({"audio": Audio()}    )
     a_    	=					Features({"transcription": Value("string"    )}    )
     a_    	=					"audio"
     a_    	=					"transcription"


     def 							_lowerCAmelCase  (      self							,		lowerCAmelCase_ ):

       '''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]							,		lowerCAmelCase_ ):
         raise ValueError(f'''Column {self.audio_column} is not an Audio type.''' )
       a_      :	int      =							copy.deepcopy(self )
       a_      :	Optional[int]      =							self.input_schema.copy()
       a_      :	Any      =							features[self.audio_column]
       a_      :	Any      =							input_schema
       return task_template






     @property
     def 							_lowerCAmelCase  (      self ):

       '''simple docstring'''

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


