Upload configuration_pawan_embd.py with huggingface_hub
Browse files- configuration_pawan_embd.py +53 -0
configuration_pawan_embd.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PretrainedConfig
|
| 2 |
+
from typing import List
|
| 3 |
+
|
| 4 |
+
class PawanEmbdConfig(PretrainedConfig):
|
| 5 |
+
"""
|
| 6 |
+
Configuration class for PawanEmbdModel
|
| 7 |
+
|
| 8 |
+
This is the configuration class to store the configuration of a PawanEmbdModel.
|
| 9 |
+
It is used to instantiate a PawanEmbd model according to the specified arguments.
|
| 10 |
+
|
| 11 |
+
Args:
|
| 12 |
+
vocab_size (int): Vocabulary size of the model. Default: 30522
|
| 13 |
+
hidden_size (int): Dimensionality of the encoder layers. Default: 256
|
| 14 |
+
num_layers (int): Number of hidden layers in the Transformer encoder. Default: 4
|
| 15 |
+
num_heads (int): Number of attention heads. Default: 4
|
| 16 |
+
intermediate_size (int): Dimensionality of the "intermediate" layer. Default: 1024
|
| 17 |
+
output_size (int): Dimensionality of the output embeddings. Default: 768
|
| 18 |
+
max_position_embeddings (int): Maximum sequence length. Default: 512
|
| 19 |
+
dropout (float): Dropout probability. Default: 0.1
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
model_type = "pawan_embd"
|
| 23 |
+
|
| 24 |
+
def __init__(
|
| 25 |
+
self,
|
| 26 |
+
vocab_size: int = 250002,
|
| 27 |
+
hidden_size: int = 256,
|
| 28 |
+
num_layers: int = 4,
|
| 29 |
+
num_heads: int = 4,
|
| 30 |
+
intermediate_size: int = 1024,
|
| 31 |
+
output_size: int = 768,
|
| 32 |
+
max_position_embeddings: int = 512,
|
| 33 |
+
dropout: float = 0.1,
|
| 34 |
+
pad_token_id: int = 1,
|
| 35 |
+
bos_token_id: int = 0,
|
| 36 |
+
eos_token_id: int = 2,
|
| 37 |
+
**kwargs
|
| 38 |
+
):
|
| 39 |
+
super().__init__(
|
| 40 |
+
pad_token_id=pad_token_id,
|
| 41 |
+
bos_token_id=bos_token_id,
|
| 42 |
+
eos_token_id=eos_token_id,
|
| 43 |
+
**kwargs
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
self.vocab_size = vocab_size
|
| 47 |
+
self.hidden_size = hidden_size
|
| 48 |
+
self.num_layers = num_layers
|
| 49 |
+
self.num_heads = num_heads
|
| 50 |
+
self.intermediate_size = intermediate_size
|
| 51 |
+
self.output_size = output_size
|
| 52 |
+
self.max_position_embeddings = max_position_embeddings
|
| 53 |
+
self.dropout = dropout
|