




import copy
import fnmatch
import json
import os
import pickle as pkl
import shutil
import sys
import tarfile
import tempfile
from collections import OrderedDict
from contextlib import contextmanager
from functools import partial
from hashlib import shaaaa
from io import BytesIO
from pathlib import Path
from urllib.parse import urlparse
from zipfile import ZipFile, is_zipfile

import cva
import numpy as np
import requests
import wget
from filelock import FileLock
from PIL import Image
from tqdm.auto import tqdm
from yaml import Loader, dump, load


try:
 import torch

 a_   		=     True
except ImportError:
 a_   		=     False


try:
 from torch.hub import _get_torch_home

 a_   		=     _get_torch_home()
except ImportError:
 a_   		=     os.path.expanduser(
     os.getenv("TORCH_HOME", os.path.join(os.getenv("XDG_CACHE_HOME", "~/.cache"), "torch"))
 )

a_   		=     os.path.join(torch_cache_home, "transformers")

a_   		=     "https://cdn.huggingface.co"
a_   		=     "https://s3.amazonaws.com/models.huggingface.co/bert"
a_   		=     "/".join(str(Path(__file__).resolve()).split("/")[:-1])
a_   		=     os.path.join(PATH, "config.yaml")
a_   		=     os.path.join(PATH, "attributes.txt")
a_   		=     os.path.join(PATH, "objects.txt")
a_   		=     os.getenv("PYTORCH_PRETRAINED_BERT_CACHE", default_cache_path)
a_   		=     os.getenv("PYTORCH_TRANSFORMERS_CACHE", PYTORCH_PRETRAINED_BERT_CACHE)
a_   		=     os.getenv("TRANSFORMERS_CACHE", PYTORCH_TRANSFORMERS_CACHE)
a_   		=     "pytorch_model.bin"
a_   		=     "config.yaml"




def 					__SCREAMING_SNAKE_CASE   (  lowercase_=OBJECTS					,     lowercase_=ATTRIBUTES      )       ->	Tuple:

    """simple docstring"""


    __UpperCamelCase  		=						[]
    with open(lowercase_      ) as f:
        for object in f.readlines():
            vg_classes.append(object.split(''','''      )[0].lower().strip()      )

    __UpperCamelCase  		=						[]
    with open(lowercase_      ) as f:
        for object in f.readlines():
            vg_attrs.append(object.split(''','''      )[0].lower().strip()      )
    return vg_classes, vg_attrs




def 					__SCREAMING_SNAKE_CASE   (  lowercase_      )       ->	Tuple:

    """simple docstring"""


    __UpperCamelCase  		=						OrderedDict()
    with open(lowercase_					,     '''rb'''      ) as f:
        __UpperCamelCase  		=						pkl.load(lowercase_      )['''model''']
    for k in copy.deepcopy(list(ckp.keys()      )      ):
        __UpperCamelCase  		=						ckp.pop(lowercase_      )
        if isinstance(lowercase_					,     np.ndarray      ):
            __UpperCamelCase  		=						torch.tensor(lowercase_      )
        else:
            assert isinstance(lowercase_					,     torch.tensor      ), type(lowercase_      )
        __UpperCamelCase  		=						v
    return r

class  _lowerCamelCase						:

      """simple docstring"""

      lowerCAmelCase__			: str    =					{}







      def __init__(     self					: Optional[Any] ,       snake_case					: dict ,       snake_case					: str = "root" ,       snake_case					: Optional[int]=0				):
          __UpperCamelCase  		=						name
          __UpperCamelCase  		=						level
          __UpperCamelCase  		=						{}
          for k, v in dictionary.items():
              if v is None:
                  raise ValueError()
              __UpperCamelCase  		=						copy.deepcopy(snake_case				)
              __UpperCamelCase  		=						copy.deepcopy(snake_case				)
              if isinstance(snake_case ,       snake_case				):
                  __UpperCamelCase  		=						Config(snake_case ,       name=snake_case ,       level=level + 1				)
              __UpperCamelCase  		=						v
              setattr(self ,       snake_case ,       snake_case				)

          __UpperCamelCase  		=						d







      def __repr__(     self					: List[Any]				):
          return str(list((self._pointer.keys())				)				)







      def __setattr__(     self					: List[str] ,       snake_case					: str ,       snake_case					: int				):
          __UpperCamelCase  		=						val
          __UpperCamelCase  		=						val
          __UpperCamelCase  		=						key.split('''.'''				)
          __UpperCamelCase  		=						len(snake_case				) - 1
          __UpperCamelCase  		=						self._pointer
          if len(snake_case				) > 1:
              for i, l in enumerate(snake_case				):
                  if hasattr(self ,       snake_case				) and isinstance(getattr(self ,       snake_case				) ,       snake_case				):
                      setattr(getattr(self ,       snake_case				) ,       '''.'''.join(levels[i:]				) ,       snake_case				)
                  if l == last_level:
                      __UpperCamelCase  		=						val
                  else:
                      __UpperCamelCase  		=						pointer[l]







      def       snake_case	(     self					: Union[str, Any]				):
          return self._pointer







      def       snake_case	(     self					: Optional[int] ,       snake_case					: Dict ,       snake_case					: List[str]				):
          with open(F"{file_name}" ,       '''w'''				) as stream:
              dump(snake_case ,       snake_case				)







      def       snake_case	(     self					: Optional[Any] ,       snake_case					: Union[str, Any] ,       snake_case					: List[str]				):
          with open(F"{file_name}" ,       '''w'''				) as stream:
              json.dump(snake_case ,       snake_case				)







      @staticmethod
      def       snake_case	(     snake_case					: Dict				):
          with open(snake_case				) as stream:
              __UpperCamelCase  		=						load(snake_case ,       Loader=snake_case				)
          return data







      def __str__(     self					: str				):
          __UpperCamelCase  		=						'''    '''
          if self._name != "root":
              __UpperCamelCase  		=						F"{t * (self._level-1)}{self._name}:\n"
          else:
              __UpperCamelCase  		=						''''''
          __UpperCamelCase  		=						self._level
          for i, (k, v) in enumerate(self._pointer.items()				):
              if isinstance(snake_case ,       snake_case				):
                  r += F"{t * (self._level)}{v}\n"
                  self._level += 1
              else:
                  r += F"{t * (self._level)}{k}: {v} ({type(snake_case				).__name__})\n"
              __UpperCamelCase  		=						level
          return r[:-1]







      @classmethod
      def       snake_case	(     cls					: List[str] ,       snake_case					: str ,       **snake_case					: int				):
          __UpperCamelCase		,      __UpperCamelCase  		=						cls.get_config_dict(snake_case ,       **snake_case				)
          return cls(snake_case				)







      @classmethod
      def       snake_case	(     cls					: str ,       snake_case					: str ,       **snake_case					: Tuple				):
          __UpperCamelCase  		=						kwargs.pop('''cache_dir''' ,       snake_case				)
          __UpperCamelCase  		=						kwargs.pop('''force_download''' ,       snake_case				)
          __UpperCamelCase  		=						kwargs.pop('''resume_download''' ,       snake_case				)
          __UpperCamelCase  		=						kwargs.pop('''proxies''' ,       snake_case				)
          __UpperCamelCase  		=						kwargs.pop('''local_files_only''' ,       snake_case				)

          if os.path.isdir(snake_case				):
              __UpperCamelCase  		=						os.path.join(snake_case ,       snake_case				)
          elif os.path.isfile(snake_case				) or is_remote_url(snake_case				):
              __UpperCamelCase  		=						pretrained_model_name_or_path
          else:
              __UpperCamelCase  		=						hf_bucket_url(snake_case ,       filename=snake_case ,       use_cdn=snake_case				)

          try:
              # Load from URL or cache if already cached
              __UpperCamelCase  		=						cached_path(
                  snake_case ,       cache_dir=snake_case ,       force_download=snake_case ,       proxies=snake_case ,       resume_download=snake_case ,       local_files_only=snake_case ,       )
              # Load config dict
              if resolved_config_file is None:
                  raise EnvironmentError

              __UpperCamelCase  		=						Config.load_yaml(snake_case				)

          except EnvironmentError:
              __UpperCamelCase  		=						'''Can\'t load config for'''
              raise EnvironmentError(snake_case				)

          if resolved_config_file == config_file:
              print('''loading configuration file from path'''				)
          else:
              print('''loading configuration file cache'''				)

          return Config.load_yaml(snake_case				), kwargs







def 					__SCREAMING_SNAKE_CASE   (  lowercase_      )       ->	Optional[Any]:

    """simple docstring"""


    __UpperCamelCase  		=						torch.load('''dump.pt'''					,     map_location=in_tensor.device      )
    __UpperCamelCase  		=						in_tensor.numpy()
    __UpperCamelCase  		=						out_tensor.numpy()[0]
    print(na.shape					,     na[0, 0, :5]      )
    print(na.shape					,     na[0, 0, :5]      )
    assert np.allclose(lowercase_					,     lowercase_					,     rtol=0.01					,     atol=0.1      ), (
        F"{sum([1 for x in np.isclose(lowercase_					,     lowercase_					,     rtol=0.01					,     atol=0.1      ).flatten() if x is False]      )/len(na.flatten()      )*1_00:.4f} %"
        " element-wise mismatch"
    )
    raise Exception('''tensors are all good'''      )

    # Hugging face functions below




def 					__SCREAMING_SNAKE_CASE   (  lowercase_      )       ->	List[Any]:

    """simple docstring"""


    __UpperCamelCase  		=						urlparse(lowercase_      )
    return parsed.scheme in ("http", "https")




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_					,     lowercase_=True      )       ->	str:

    """simple docstring"""


    __UpperCamelCase  		=						CLOUDFRONT_DISTRIB_PREFIX if use_cdn else S3_BUCKET_PREFIX
    __UpperCamelCase  		=						'''/''' not in model_id
    if legacy_format:
        return F"{endpoint}/{model_id}-{filename}"
    else:
        return F"{endpoint}/{model_id}/{filename}"




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_					,     lowercase_=None					,     lowercase_=0					,     lowercase_=None					,     )       ->	Dict:

    """simple docstring"""


    __UpperCamelCase  		=						'''python/{}'''.format(sys.version.split()[0]      )
    if _torch_available:
        ua += "; torch/{}".format(torch.__version__      )
    if isinstance(lowercase_					,     lowercase_      ):
        ua += "; " + "; ".join('''{}/{}'''.format(lowercase_					,     lowercase_      ) for k, v in user_agent.items()      )
    elif isinstance(lowercase_					,     lowercase_      ):
        ua += "; " + user_agent
    __UpperCamelCase  		=						{'''user-agent''': ua}
    if resume_size > 0:
        __UpperCamelCase  		=						'''bytes=%d-''' % (resume_size,)
    __UpperCamelCase  		=						requests.get(lowercase_					,     stream=lowercase_					,     proxies=lowercase_					,     headers=lowercase_      )
    if response.status_code == 4_16:  # Range not satisfiable
        return
    __UpperCamelCase  		=						response.headers.get('''Content-Length'''      )
    __UpperCamelCase  		=						resume_size + int(lowercase_      ) if content_length is not None else None
    __UpperCamelCase  		=						tqdm(
        unit='''B'''					,     unit_scale=lowercase_					,     total=lowercase_					,     initial=lowercase_					,     desc='''Downloading'''					,     )
    for chunk in response.iter_content(chunk_size=10_24      ):
        if chunk:  # filter out keep-alive new chunks
            progress.update(len(lowercase_      )      )
            temp_file.write(lowercase_      )
    progress.close()




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_=None					,     lowercase_=False					,     lowercase_=None					,     lowercase_=10					,     lowercase_=False					,     lowercase_=None					,     lowercase_=False					,     )       ->	Tuple:

    """simple docstring"""


    if cache_dir is None:
        __UpperCamelCase  		=						TRANSFORMERS_CACHE
    if isinstance(lowercase_					,     lowercase_      ):
        __UpperCamelCase  		=						str(lowercase_      )

    os.makedirs(lowercase_					,     exist_ok=lowercase_      )

    __UpperCamelCase  		=						None
    if not local_files_only:
        try:
            __UpperCamelCase  		=						requests.head(lowercase_					,     allow_redirects=lowercase_					,     proxies=lowercase_					,     timeout=lowercase_      )
            if response.status_code == 2_00:
                __UpperCamelCase  		=						response.headers.get('''ETag'''      )
        except (EnvironmentError, requests.exceptions.Timeout):
            # etag is already None
            pass

    __UpperCamelCase  		=						url_to_filename(lowercase_					,     lowercase_      )

    # get cache path to put the file
    __UpperCamelCase  		=						os.path.join(lowercase_					,     lowercase_      )

    # etag is None = we don't have a connection, or url doesn't exist, or is otherwise inaccessible.
    # try to get the last downloaded one
    if etag is None:
        if os.path.exists(lowercase_      ):
            return cache_path
        else:
            __UpperCamelCase  		=						[
                file
                for file in fnmatch.filter(os.listdir(lowercase_      )					,     filename + '''.*'''      )
                if not file.endswith('''.json'''      ) and not file.endswith('''.lock'''      )
            ]
            if len(lowercase_      ) > 0:
                return os.path.join(lowercase_					,     matching_files[-1]      )
            else:
                # If files cannot be found and local_files_only=True,
                # the models might've been found if local_files_only=False
                # Notify the user about that
                if local_files_only:
                    raise ValueError(
                        '''Cannot find the requested files in the cached path and outgoing traffic has been'''
                        ''' disabled. To enable model look-ups and downloads online, set \'local_files_only\''''
                        ''' to False.'''      )
                return None

    # From now on, etag is not None.
    if os.path.exists(lowercase_      ) and not force_download:
        return cache_path

    # Prevent parallel downloads of the same file with a lock.
    __UpperCamelCase  		=						cache_path + '''.lock'''
    with FileLock(lowercase_      ):
        # If the download just completed while the lock was activated.
        if os.path.exists(lowercase_      ) and not force_download:
            # Even if returning early like here, the lock will be released.
            return cache_path

        if resume_download:
            __UpperCamelCase  		=						cache_path + '''.incomplete'''

            @contextmanager
            def _resumable_file_manager():
                with open(lowercase_					,     '''a+b'''      ) as f:
                    yield f

            __UpperCamelCase  		=						_resumable_file_manager
            if os.path.exists(lowercase_      ):
                __UpperCamelCase  		=						os.stat(lowercase_      ).st_size
            else:
                __UpperCamelCase  		=						0
        else:
            __UpperCamelCase  		=						partial(tempfile.NamedTemporaryFile					,     dir=lowercase_					,     delete=lowercase_      )
            __UpperCamelCase  		=						0

        # Download to temporary file, then copy to cache dir once finished.
        # Otherwise you get corrupt cache entries if the download gets interrupted.
        with temp_file_manager() as temp_file:
            print(
                '''%s not found in cache or force_download set to True, downloading to %s'''					,     lowercase_					,     temp_file.name					,     )

            http_get(
                lowercase_					,     lowercase_					,     proxies=lowercase_					,     resume_size=lowercase_					,     user_agent=lowercase_					,     )

        os.replace(temp_file.name					,     lowercase_      )

        __UpperCamelCase  		=						{'''url''': url, '''etag''': etag}
        __UpperCamelCase  		=						cache_path + '''.json'''
        with open(lowercase_					,     '''w'''      ) as meta_file:
            json.dump(lowercase_					,     lowercase_      )

    return cache_path




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_=None      )       ->	int:

    """simple docstring"""


    __UpperCamelCase  		=						url.encode('''utf-8'''      )
    __UpperCamelCase  		=						shaaaa(lowercase_      )
    __UpperCamelCase  		=						url_hash.hexdigest()

    if etag:
        __UpperCamelCase  		=						etag.encode('''utf-8'''      )
        __UpperCamelCase  		=						shaaaa(lowercase_      )
        filename += "." + etag_hash.hexdigest()

    if url.endswith('''.h5'''      ):
        filename += ".h5"

    return filename




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_=None					,     lowercase_=False					,     lowercase_=None					,     lowercase_=False					,     lowercase_=None					,     lowercase_=False					,     lowercase_=False					,     lowercase_=False					,     )       ->	Optional[int]:

    """simple docstring"""


    if cache_dir is None:
        __UpperCamelCase  		=						TRANSFORMERS_CACHE
    if isinstance(lowercase_					,     lowercase_      ):
        __UpperCamelCase  		=						str(lowercase_      )
    if isinstance(lowercase_					,     lowercase_      ):
        __UpperCamelCase  		=						str(lowercase_      )

    if is_remote_url(lowercase_      ):
        # URL, so get it from the cache (downloading if necessary)
        __UpperCamelCase  		=						get_from_cache(
            lowercase_					,     cache_dir=lowercase_					,     force_download=lowercase_					,     proxies=lowercase_					,     resume_download=lowercase_					,     user_agent=lowercase_					,     local_files_only=lowercase_					,     )
    elif os.path.exists(lowercase_      ):
        # File, and it exists.
        __UpperCamelCase  		=						url_or_filename
    elif urlparse(lowercase_      ).scheme == "":
        # File, but it doesn't exist.
        raise EnvironmentError('''file {} not found'''.format(lowercase_      )      )
    else:
        # Something unknown
        raise ValueError('''unable to parse {} as a URL or as a local path'''.format(lowercase_      )      )

    if extract_compressed_file:
        if not is_zipfile(lowercase_      ) and not tarfile.is_tarfile(lowercase_      ):
            return output_path

        # Path where we extract compressed archives
        # We avoid '.' in dir name and add "-extracted" at the end: "./model.zip" => "./model-zip-extracted/"
        __UpperCamelCase		,      __UpperCamelCase  		=						os.path.split(lowercase_      )
        __UpperCamelCase  		=						output_file.replace('''.'''					,     '''-'''      ) + '''-extracted'''
        __UpperCamelCase  		=						os.path.join(lowercase_					,     lowercase_      )

        if os.path.isdir(lowercase_      ) and os.listdir(lowercase_      ) and not force_extract:
            return output_path_extracted

        # Prevent parallel extractions
        __UpperCamelCase  		=						output_path + '''.lock'''
        with FileLock(lowercase_      ):
            shutil.rmtree(lowercase_					,     ignore_errors=lowercase_      )
            os.makedirs(lowercase_      )
            if is_zipfile(lowercase_      ):
                with ZipFile(lowercase_					,     '''r'''      ) as zip_file:
                    zip_file.extractall(lowercase_      )
                    zip_file.close()
            elif tarfile.is_tarfile(lowercase_      ):
                __UpperCamelCase  		=						tarfile.open(lowercase_      )
                tar_file.extractall(lowercase_      )
                tar_file.close()
            else:
                raise EnvironmentError('''Archive format of {} could not be identified'''.format(lowercase_      )      )

        return output_path_extracted

    return output_path




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_=","      )       ->	Any:

    """simple docstring"""


    assert isinstance(lowercase_					,     lowercase_      )
    if os.path.isfile(lowercase_      ):
        with open(lowercase_      ) as f:
            __UpperCamelCase  		=						eval(f.read()      )
    else:
        __UpperCamelCase  		=						requests.get(lowercase_      )
        try:
            __UpperCamelCase  		=						requests.json()
        except Exception:
            __UpperCamelCase  		=						req.content.decode()
            assert data is not None, "could not connect"
            try:
                __UpperCamelCase  		=						eval(lowercase_      )
            except Exception:
                __UpperCamelCase  		=						data.split('''\n'''      )
        req.close()
    return data




def 					__SCREAMING_SNAKE_CASE   (  lowercase_      )       ->	Any:

    """simple docstring"""


    __UpperCamelCase  		=						requests.get(lowercase_      )
    __UpperCamelCase  		=						np.array(Image.open(BytesIO(response.content      )      )      )
    return img




def 					__SCREAMING_SNAKE_CASE   (  lowercase_      )       ->	Union[str, Any]:

    """simple docstring"""


    __UpperCamelCase  		=						url.split('''/'''      )[-1]
    if fn not in os.listdir(os.getcwd()      ):
        wget.download(lowercase_      )
    with open(lowercase_					,     '''rb'''      ) as stream:
        __UpperCamelCase  		=						pkl.load(lowercase_      )
    __UpperCamelCase  		=						weights.pop('''model'''      )
    __UpperCamelCase  		=						{}
    for k, v in model.items():
        __UpperCamelCase  		=						torch.from_numpy(lowercase_      )
        if "running_var" in k:
            __UpperCamelCase  		=						torch.tensor([0]      )
            __UpperCamelCase  		=						k.replace('''running_var'''					,     '''num_batches_tracked'''      )
            __UpperCamelCase  		=						zero
    return new




def 					__SCREAMING_SNAKE_CASE   (  )       ->	Union[str, Any]:

    """simple docstring"""


    print(F"{os.path.abspath(os.path.join(lowercase_					,     os.pardir      )      )}/demo.ipynb"      )




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_="RGB"      )       ->	str:

    """simple docstring"""


    assert isinstance(lowercase_					,     lowercase_      )
    if os.path.isfile(lowercase_      ):
        __UpperCamelCase  		=						cva.imread(lowercase_      )
    else:
        __UpperCamelCase  		=						get_image_from_url(lowercase_      )
        assert img is not None, F"could not connect to: {im}"
    __UpperCamelCase  		=						cva.cvtColor(lowercase_					,     cva.COLOR_BGR2RGB      )
    if input_format == "RGB":
        __UpperCamelCase  		=						img[:, :, ::-1]
    return img




def 					__SCREAMING_SNAKE_CASE   (  lowercase_					,     lowercase_=1      )       ->	Any:

    """simple docstring"""


    return (images[i : i + batch] for i in range(0					,     len(lowercase_      )					,     lowercase_      ))












from ....configuration_utils import PretrainedConfig
from ....utils import logging


a_   		=     logging.get_logger(__name__)

a_   		=     {
    "speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json",
    # See all M-CTC-T models at https://huggingface.co/models?filter=mctct
}

class  _lowerCamelCase						(			_SCREAMING_SNAKE_CASE   ):

      """simple docstring"""

      lowerCAmelCase__			: int    =					"mctct"







      def __init__(     self					: List[Any] ,       snake_case					: Optional[Any]=8065 ,       snake_case					: Optional[int]=1536 ,       snake_case					: Any=36 ,       snake_case					: List[str]=6144 ,       snake_case					: Dict=4 ,       snake_case					: str=384 ,       snake_case					: List[str]=920 ,       snake_case					: Dict=1E-5 ,       snake_case					: Union[str, Any]=0.3 ,       snake_case					: Optional[Any]="relu" ,       snake_case					: str=0.02 ,       snake_case					: Optional[int]=0.3 ,       snake_case					: int=0.3 ,       snake_case					: Any=1 ,       snake_case					: int=0 ,       snake_case					: Union[str, Any]=2 ,       snake_case					: List[Any]=1 ,       snake_case					: Dict=0.3 ,       snake_case					: int=1 ,       snake_case					: Optional[int]=(7,) ,       snake_case					: List[Any]=(3,) ,       snake_case					: Optional[int]=80 ,       snake_case					: List[str]=1 ,       snake_case					: int=None ,       snake_case					: List[str]="sum" ,       snake_case					: Tuple=False ,       **snake_case					: List[str] ,       ):
          super().__init__(**snake_case ,       pad_token_id=snake_case ,       bos_token_id=snake_case ,       eos_token_id=snake_case				)
          __UpperCamelCase  		=						vocab_size
          __UpperCamelCase  		=						hidden_size
          __UpperCamelCase  		=						num_hidden_layers
          __UpperCamelCase  		=						intermediate_size
          __UpperCamelCase  		=						num_attention_heads
          __UpperCamelCase  		=						attention_head_dim
          __UpperCamelCase  		=						max_position_embeddings
          __UpperCamelCase  		=						layer_norm_eps
          __UpperCamelCase  		=						layerdrop
          __UpperCamelCase  		=						hidden_act
          __UpperCamelCase  		=						initializer_range
          __UpperCamelCase  		=						hidden_dropout_prob
          __UpperCamelCase  		=						attention_probs_dropout_prob
          __UpperCamelCase  		=						pad_token_id
          __UpperCamelCase  		=						bos_token_id
          __UpperCamelCase  		=						eos_token_id
          __UpperCamelCase  		=						conv_glu_dim
          __UpperCamelCase  		=						conv_dropout
          __UpperCamelCase  		=						num_conv_layers
          __UpperCamelCase  		=						input_feat_per_channel
          __UpperCamelCase  		=						input_channels
          __UpperCamelCase  		=						conv_channels
          __UpperCamelCase  		=						ctc_loss_reduction
          __UpperCamelCase  		=						ctc_zero_infinity

          # prevents config testing fail with exporting to json
          __UpperCamelCase  		=						list(snake_case				)
          __UpperCamelCase  		=						list(snake_case				)

          if len(self.conv_kernel				) != self.num_conv_layers:
              raise ValueError(
                  '''Configuration for convolutional module is incorrect. '''
                  '''It is required that `len(config.conv_kernel)` == `config.num_conv_layers` '''
                  F"but is `len(config.conv_kernel) = {len(self.conv_kernel				)}`, "
                  F"`config.num_conv_layers = {self.num_conv_layers}`."				)






