File size: 1,849 Bytes
369c732 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
from transformers.configuration_utils import PretrainedConfig
from transformers.utils import logging
logger = logging.get_logger(__name__)
class ProPrimeConfig(PretrainedConfig):
model_type = "proprime"
def __init__(
self,
vocab_size=33,
mask_token_id=32,
pad_token_id=1,
hidden_size=768,
num_hidden_layers=12,
num_attention_heads=12,
intermediate_size=3072,
hidden_dropout_prob=0.1,
attention_probs_dropout_prob=0.1,
max_position_embeddings=1026,
initializer_range=0.02,
layer_norm_eps=1e-12,
position_embedding_type="rotary",
use_cache=True,
emb_layer_norm_before=None,
token_dropout=False,
flash_attention=True,
structure_vocab_size=100,
value_loss_scale=0.01,
**kwargs,
):
super().__init__(
pad_token_id=pad_token_id, mask_token_id=mask_token_id, **kwargs
)
self.vocab_size = vocab_size
self.hidden_size = hidden_size
self.num_hidden_layers = num_hidden_layers
self.num_attention_heads = num_attention_heads
self.intermediate_size = intermediate_size
self.hidden_dropout_prob = hidden_dropout_prob
self.attention_probs_dropout_prob = attention_probs_dropout_prob
self.max_position_embeddings = max_position_embeddings
self.initializer_range = initializer_range
self.layer_norm_eps = layer_norm_eps
self.position_embedding_type = position_embedding_type
self.use_cache = use_cache
self.emb_layer_norm_before = emb_layer_norm_before
self.token_dropout = token_dropout
self.flash_attention = flash_attention
self.structure_vocab_size = structure_vocab_size
ProPrimeConfig.register_for_auto_class() |