





'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase__   :				Any      =   {
    '''configuration_clipseg''': [
        '''CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''CLIPSegConfig''',
        '''CLIPSegTextConfig''',
        '''CLIPSegVisionConfig''',
    ],
    '''processing_clipseg''': ['''CLIPSegProcessor'''],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase__   :				List[Any]      =   [
      '''CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''CLIPSegModel''',
      '''CLIPSegPreTrainedModel''',
      '''CLIPSegTextModel''',
      '''CLIPSegVisionModel''',
      '''CLIPSegForImageSegmentation''',
  ]

if TYPE_CHECKING:
  from .configuration_clipseg import (
      CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP,
      CLIPSegConfig,
      CLIPSegTextConfig,
      CLIPSegVisionConfig,
  )
  from .processing_clipseg import CLIPSegProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_clipseg import (
        CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST,
        CLIPSegForImageSegmentation,
        CLIPSegModel,
        CLIPSegPreTrainedModel,
        CLIPSegTextModel,
        CLIPSegVisionModel,
    )

else:
  import sys

  lowercase__   :				int      =   _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






'''simple docstring'''




import argparse


lowercase__   :				Any      =   '''docs/source/_static/js/custom.js'''






def 	_lowerCAmelCase      (  __snake_case  :			Union[str, Any]      )					->					str:
     with open(__snake_case			,							encoding='utf-8'			,							newline='\n'      ) as f:
          __A						:			Optional[Any]								=	f.readlines()
     __A						:			List[str]								=	0

     # First let's put the right version
     while not lines[index].startswith('const stableVersion ='      ):
          index += 1
     __A						:			Tuple								=	f'const stableVersion = "v{version}"\n'

     # Then update the dictionary
     while not lines[index].startswith('const versionMapping = {'      ):
          index += 1

     # We go until the end
     while not lines[index].startswith('}'      ):
          index += 1
     # We add the new version at the end
     lines[index - 1] += f'    "v{version}": "v{version}",\n'

     with open(__snake_case			,							'w'			,							encoding='utf-8'			,							newline='\n'      ) as f:
          f.writelines(__snake_case      )


if __name__ == "__main__":
  lowercase__   :				Optional[Any]      =   argparse.ArgumentParser()
  parser.add_argument('''--version''', help='''Release version.''')
  lowercase__   :				List[str]      =   parser.parse_args()
  update_custom_js(args.version)