from transformers import PretrainedConfig | |
from typing import List | |
class MGPTConfig(PretrainedConfig): | |
model_type = "mgpt" | |
def __init__( | |
self, | |
block_size: int = 1024, | |
vocab_size: int = 12000, | |
n_layer: int = 12, | |
n_head: int = 8, | |
n_embd: int = 512, | |
dropout: float = 0.1, | |
bias: bool = False, | |
**kwargs, | |
): | |
self.block_size = block_size | |
self.vocab_size = vocab_size | |
self.n_layer = n_layer | |
self.n_head = n_head | |
self.n_embd = n_embd | |
self.dropout = dropout | |
self.bias = bias | |
super().__init__(**kwargs) | |