code: 
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available
  
  
  _SCREAMING_SNAKE_CASE    :				Union[str, Any]       =					{
      '''configuration_wav2vec2_conformer''': [
          '''WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
          '''Wav2Vec2ConformerConfig''',
      ],
  }
  
  
  try:
   if not is_torch_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   _SCREAMING_SNAKE_CASE    :				Dict       =					[
       '''WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''Wav2Vec2ConformerForAudioFrameClassification''',
       '''Wav2Vec2ConformerForCTC''',
       '''Wav2Vec2ConformerForPreTraining''',
       '''Wav2Vec2ConformerForSequenceClassification''',
       '''Wav2Vec2ConformerForXVector''',
       '''Wav2Vec2ConformerModel''',
       '''Wav2Vec2ConformerPreTrainedModel''',
   ]
  
  if TYPE_CHECKING:
   from .configuration_wavaveca_conformer import (
       WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
       WavaVecaConformerConfig,
   )
  
   try:
    if not is_torch_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_wavaveca_conformer import (
        WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        WavaVecaConformerForAudioFrameClassification,
        WavaVecaConformerForCTC,
        WavaVecaConformerForPreTraining,
        WavaVecaConformerForSequenceClassification,
        WavaVecaConformerForXVector,
        WavaVecaConformerModel,
        WavaVecaConformerPreTrainedModel,
    )
  
  else:
   import sys
  
   _SCREAMING_SNAKE_CASE    :				List[str]       =					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
  
  
  
  
style_context: 
  
  
  import torch
  
  from accelerate import Accelerator, DistributedType
  
  class 						A__      :
  
  
  
  
  
  
  
      """simple docstring"""
  
      def __enter__( self					):
           if self.enabled:
                snake_case					=       self.model.no_sync()
                self.model_sync_obj.__enter__()
  
           return self
      def __exit__( self    ,      __snake_case    ,      __snake_case    ,      __snake_case					):
           if self.enabled:
                # Average all models on exit
                self._sync_and_avg_model_params()
                self.model_sync_obj.__exit__(__snake_case    ,      __snake_case    ,      __snake_case					)
      def __init__( self    ,      __snake_case    ,      __snake_case    ,      __snake_case    ,      __snake_case = True					):
           if accelerator.distributed_type not in [
               DistributedType.NO,
               DistributedType.MULTI_CPU,
               DistributedType.MULTI_GPU,
           ]:
                raise NotImplementedError('''LocalSGD is supported only for CPUs and GPUs (no DeepSpeed or MegatronLM)'''					)
           snake_case					=       enabled and accelerator.distributed_type != DistributedType.NO
           snake_case					=       0
           if self.enabled:
                snake_case					=       accelerator
                snake_case					=       model
                snake_case					=       local_sgd_steps
      def 	a_    ( self					):
           self.num_steps += 1
           if not self.enabled:
                return
  
           if self.num_steps % self.local_sgd_steps == 0:
                self._sync_and_avg_model_params()
  
  
  
  
      def 	a_    ( self					):
           self.accelerator.wait_for_everyone()
           with self.accelerator.autocast():
                for param in self.model.parameters():
                     snake_case					=       self.accelerator.reduce(param.data    ,      reduction='''mean'''					)
  
  
  
  
  