





'''simple docstring'''







from typing import Optional, Tuple

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


_a					: Optional[int]      =    logging.get_logger(__name__)

_a					: List[Any]      =    {"""vocab_file""": """vocab.json""", """merges_file""": """merges.txt""", """tokenizer_file""": """tokenizer.json"""}

_a					: str      =    {
    """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"""},
}

_a					: List[str]      =    {
    """openai-gpt""": 5_1_2,
}





class     _UpperCAmelCase							(						lowerCAmelCase_   ):
		a   :   Optional[Any]     =VOCAB_FILES_NAMES
		a   :   str     =PRETRAINED_VOCAB_FILES_MAP
		a   :   int     =PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		a   :   Tuple     =["""input_ids""", """attention_mask"""]
		a   :   Optional[int]     =OpenAIGPTTokenizer
		def __init__(  self,__SCREAMING_SNAKE_CASE=None,__SCREAMING_SNAKE_CASE=None,__SCREAMING_SNAKE_CASE=None,__SCREAMING_SNAKE_CASE="<unk>",**__SCREAMING_SNAKE_CASE			):



					'''simple docstring'''

					super().__init__(__SCREAMING_SNAKE_CASE,__SCREAMING_SNAKE_CASE,tokenizer_file=__SCREAMING_SNAKE_CASE,unk_token=__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE			)
		@property
		def   lowerCamelCase__			(  self			):



					'''simple docstring'''

					return True







		def   lowerCamelCase__			(  self,__SCREAMING_SNAKE_CASE,__SCREAMING_SNAKE_CASE = None			):



					'''simple docstring'''

					__lowerCAmelCase											=				self._tokenizer.model.save(__SCREAMING_SNAKE_CASE,name=__SCREAMING_SNAKE_CASE			)
					return tuple(__SCREAMING_SNAKE_CASE			)








'''simple docstring'''







import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import Mock, patch

import diffusers.utils.hub_utils





class     _UpperCAmelCase							(						unittest.TestCase   ):
		@patch("""diffusers.utils.hub_utils.get_full_repo_name"""			)
		def   lowerCamelCase__			(  self,__SCREAMING_SNAKE_CASE			):



					'''simple docstring'''

					__lowerCAmelCase											=				"""full_repo_name"""
					with TemporaryDirectory() as tmpdir:
								# Dummy args values
								__lowerCAmelCase											=				Mock()
								__lowerCAmelCase											=				tmpdir
								__lowerCAmelCase											=				0
								__lowerCAmelCase											=				"""hub_token"""
								__lowerCAmelCase											=				"""dataset_name"""
								__lowerCAmelCase											=				0.01
								__lowerCAmelCase											=				10_00_00
								__lowerCAmelCase											=				1_00_00
								__lowerCAmelCase											=				0.01
								__lowerCAmelCase											=				0.02
								__lowerCAmelCase											=				0.03
								__lowerCAmelCase											=				0.0005
								__lowerCAmelCase											=				0.00_0001
								__lowerCAmelCase											=				1
								__lowerCAmelCase											=				10
								__lowerCAmelCase											=				0.001
								__lowerCAmelCase											=				0.1
								__lowerCAmelCase											=				0.2
								__lowerCAmelCase											=				True

								# Model card mush be rendered and saved
								diffusers.utils.hub_utils.create_model_card(__SCREAMING_SNAKE_CASE,model_name="""model_name"""			)
								self.assertTrue((Path(__SCREAMING_SNAKE_CASE			) / """README.md""").is_file()			)

