Create configuration_lizard.py
Browse files- configuration_lizard.py +27 -0
configuration_lizard.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
from transformers import PretrainedConfig
|
| 3 |
+
|
| 4 |
+
class LizardConfig(PretrainedConfig):
|
| 5 |
+
"""
|
| 6 |
+
This is the configuration class to store the configuration of a `LizardModel`.
|
| 7 |
+
It inherits from PretrainedConfig to get Hugging Face functionality.
|
| 8 |
+
"""
|
| 9 |
+
model_type = "lizard"
|
| 10 |
+
|
| 11 |
+
def __init__(
|
| 12 |
+
self,
|
| 13 |
+
vocab_size=24005,
|
| 14 |
+
d_model=256,
|
| 15 |
+
n_heads=8,
|
| 16 |
+
n_layers=6,
|
| 17 |
+
max_length=128,
|
| 18 |
+
pad_token_id=0,
|
| 19 |
+
**kwargs
|
| 20 |
+
):
|
| 21 |
+
self.vocab_size = vocab_size
|
| 22 |
+
self.d_model = d_model
|
| 23 |
+
self.n_heads = n_heads
|
| 24 |
+
self.n_layers = n_layers
|
| 25 |
+
self.max_length = max_length
|
| 26 |
+
self.pad_token_id = pad_token_id
|
| 27 |
+
super().__init__(pad_token_id=pad_token_id, **kwargs)
|