

from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
  if not (is_transformers_available() and is_torch_available() and is_transformers_version(">=", "4.27.0")):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from ...utils.dummy_torch_and_transformers_objects import (
      AudioLDMPipeline,
  )
else:
  from .pipeline_audioldm import AudioLDMPipeline






from typing import Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_openai import OpenAIGPTTokenizer


_UpperCAmelCase    	=			logging.get_logger(__name__)

_UpperCAmelCase    	=			{"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"}

_UpperCAmelCase    	=			{
    "vocab_file": {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/vocab.json"},
    "merges_file": {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/merges.txt"},
    "tokenizer_file": {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/tokenizer.json"},
}

_UpperCAmelCase    	=			{
    "openai-gpt": 512,
}



class        _UpperCAmelCase (   __lowercase			):
  '''simple docstring'''







  SCREAMING_SNAKE_CASE							:				Union[str, Any]					      =				VOCAB_FILES_NAMES
  SCREAMING_SNAKE_CASE							:				Any					      =				PRETRAINED_VOCAB_FILES_MAP
  SCREAMING_SNAKE_CASE							:				Dict					      =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  SCREAMING_SNAKE_CASE							:				List[str]					      =				['''input_ids''', '''attention_mask''']
  SCREAMING_SNAKE_CASE							:				Tuple					      =				OpenAIGPTTokenizer







  def __init__( self	: Dict		,						UpperCamelCase__	: List[Any]=None		,						UpperCamelCase__	: Union[str, Any]=None		,						UpperCamelCase__	: Optional[int]=None		,						UpperCamelCase__	: Tuple="<unk>"		,						**UpperCamelCase__	: Union[str, Any] ):
        super().__init__(UpperCamelCase__		,						UpperCamelCase__		,						tokenizer_file=UpperCamelCase__		,						unk_token=UpperCamelCase__		,						**UpperCamelCase__ )







  @property
  def 	UpperCamelCase       ( self	: Optional[Any] ):
        return True







  def 	UpperCamelCase       ( self	: Dict		,						UpperCamelCase__	: str		,						UpperCamelCase__	: Optional[str] = None ):
        A    =				self._tokenizer.model.save(UpperCamelCase__		,						name=UpperCamelCase__ )
        return tuple(UpperCamelCase__ )



