






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE__     =       {
    'configuration_mgp_str': ['MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MgpstrConfig'],
    'processing_mgp_str': ['MgpstrProcessor'],
    'tokenization_mgp_str': ['MgpstrTokenizer'],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     SCREAMING_SNAKE_CASE__     =       [
         'MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST',
         'MgpstrModel',
         'MgpstrPreTrainedModel',
         'MgpstrForSceneTextRecognition',
     ]

if TYPE_CHECKING:
     from .configuration_mgp_str import MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig
     from .processing_mgp_str import MgpstrProcessor
     from .tokenization_mgp_str import MgpstrTokenizer

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_mgp_str import (
              MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST,
              MgpstrForSceneTextRecognition,
              MgpstrModel,
              MgpstrPreTrainedModel,
          )
else:
     import sys

     SCREAMING_SNAKE_CASE__     =       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)








'''simple docstring'''

import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


SCREAMING_SNAKE_CASE__     =       'scheduler_config.json'






class     a_						(      lowerCamelCase    ):
  lowercase							=				1
  lowercase							=				2
  lowercase							=				3
  lowercase							=				4
  lowercase							=				5
  lowercase							=				6
  lowercase							=				7
  lowercase							=				8
  lowercase							=				9
  lowercase							=				10
  lowercase							=				11
  lowercase							=				12
  lowercase							=				13
  lowercase							=				14






@dataclass
class     a_						(      lowerCamelCase    ):
  lowercase							=				42






class     a_						:
  lowercase							=				SCHEDULER_CONFIG_NAME
  lowercase							=				[]
  lowercase							=				True

  @classmethod
  def   A__						(				cls      ,		_SCREAMING_SNAKE_CASE = None      ,		_SCREAMING_SNAKE_CASE = None      ,		_SCREAMING_SNAKE_CASE=False      ,		**_SCREAMING_SNAKE_CASE      ,		)  ->				Optional[Any]:



        """simple docstring"""






        UpperCamelCase  ,UpperCamelCase  ,UpperCamelCase      = cls.load_config(
            pretrained_model_name_or_path=_SCREAMING_SNAKE_CASE      ,		subfolder=_SCREAMING_SNAKE_CASE      ,		return_unused_kwargs=_SCREAMING_SNAKE_CASE      ,		return_commit_hash=_SCREAMING_SNAKE_CASE      ,		**_SCREAMING_SNAKE_CASE      ,		)
        return cls.from_config(_SCREAMING_SNAKE_CASE      ,		return_unused_kwargs=_SCREAMING_SNAKE_CASE      ,		**_SCREAMING_SNAKE_CASE				)

  def   A__						(				self      ,		_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE = False      ,		**_SCREAMING_SNAKE_CASE				)  ->				Dict:



        """simple docstring"""






        self.save_config(save_directory=_SCREAMING_SNAKE_CASE      ,		push_to_hub=_SCREAMING_SNAKE_CASE      ,		**_SCREAMING_SNAKE_CASE				)

  @property
  def   A__						(				self				)  ->				Tuple:



        """simple docstring"""






        return self._get_compatibles()


  @classmethod
  def   A__						(				cls				)  ->				List[Any]:



        """simple docstring"""






        UpperCamelCase      = list(set([cls.__name__] + cls._compatibles				)				)
        UpperCamelCase      = importlib.import_module(__name__.split("""."""				)[0]				)
        UpperCamelCase      = [
            getattr(_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE				) for c in compatible_classes_str if hasattr(_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE				)
        ]
        return compatible_classes
