


from ...configuration_utils import PretrainedConfig
from ...utils import logging


_A      =     logging.get_logger(__name__)

_A      =     {
    """facebook/opt-125m""": """https://huggingface.co/facebook/opt-125m/blob/main/config.json""",
    """facebook/opt-350m""": """https://huggingface.co/facebook/opt-350m/blob/main/config.json""",
    """facebook/opt-1.3b""": """https://huggingface.co/facebook/opt-1.3b/blob/main/config.json""",
    """facebook/opt-2.7b""": """https://huggingface.co/facebook/opt-2.7b/blob/main/config.json""",
    """facebook/opt-6.7b""": """https://huggingface.co/facebook/opt-6.7b/blob/main/config.json""",
    """facebook/opt-13b""": """https://huggingface.co/facebook/opt-13b/blob/main/config.json""",
}






class      SCREAMING_SNAKE_CASE_	( UpperCamelCase__		):
			__a					:      List[str]					=  '''opt'''
			__a					:      Any					=  ['''past_key_values''']




			def __init__(      self					,      lowercase=5_0_2_7_2					,      lowercase=7_6_8					,      lowercase=1_2					,      lowercase=3_0_7_2					,      lowercase=2_0_4_8					,      lowercase=True					,      lowercase=False					,      lowercase=None					,      lowercase=0.1					,      lowercase=0.0					,      lowercase=1_2					,      lowercase="relu"					,      lowercase=0.0					,      lowercase=0.0_2					,      lowercase=True					,      lowercase=1					,      lowercase=2					,      lowercase=2					,      lowercase=True					,      lowercase=True					,      **lowercase					,      )			->						Any:


								'''simple docstring'''






								super().__init__(
								    pad_token_id=snake_case_					,      bos_token_id=snake_case_					,      eos_token_id=snake_case_					,      **snake_case_					,      )
								__SCREAMING_SNAKE_CASE					:							List[str]			   = vocab_size
								__SCREAMING_SNAKE_CASE					:							Optional[int]			   = max_position_embeddings
								__SCREAMING_SNAKE_CASE					:							Optional[int]			   = num_attention_heads
								__SCREAMING_SNAKE_CASE					:							int			   = word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
								__SCREAMING_SNAKE_CASE					:							Union[str, Any]			   = ffn_dim
								__SCREAMING_SNAKE_CASE					:							Any			   = hidden_size
								__SCREAMING_SNAKE_CASE					:							str			   = num_hidden_layers
								__SCREAMING_SNAKE_CASE					:							str			   = dropout
								__SCREAMING_SNAKE_CASE					:							List[Any]			   = attention_dropout
								__SCREAMING_SNAKE_CASE					:							Tuple			   = activation_function
								__SCREAMING_SNAKE_CASE					:							List[str]			   = init_std
								__SCREAMING_SNAKE_CASE					:							int			   = layerdrop
								__SCREAMING_SNAKE_CASE					:							Dict			   = use_cache
								__SCREAMING_SNAKE_CASE					:							List[str]			   = do_layer_norm_before
								# We keep these variables at `True` for backward compatibility.
								__SCREAMING_SNAKE_CASE					:							Optional[int]			   = enable_bias
								__SCREAMING_SNAKE_CASE					:							Optional[Any]			   = layer_norm_elementwise_affine

								# Note that the only purpose of `_remove_final_layer_norm` is to keep backward compatibility
								# with checkpoints that have been fine-tuned before transformers v4.20.1
								# see https://github.com/facebookresearch/metaseq/pull/164
								__SCREAMING_SNAKE_CASE					:							Dict			   = _remove_final_layer_norm






'''simple docstring'''






# this script builds a small sample spm file tests/fixtures/test_sentencepiece_no_bos.model, with features needed by pegasus

# 1. pip install sentencepiece
#
# 2. wget https://raw.githubusercontent.com/google/sentencepiece/master/data/botchan.txt

# 3. build
import sentencepiece as spm

# pegasus:
# 1. no bos
# 2. eos_id is 1
# 3. unk_id is 2
# build a sample spm file accordingly
spm.SentencePieceTrainer.train(
    """--input=botchan.txt --model_prefix=test_sentencepiece_no_bos --bos_id=-1 --unk_id=2  --eos_id=1  --vocab_size=1000"""
)

# 4. now update the fixture
# mv test_sentencepiece_no_bos.model ../../tests/fixtures/


