HenrySentinel commited on
Commit
3623324
·
verified ·
1 Parent(s): b5a618f

Add configuration_tinymind.py

Browse files
Files changed (1) hide show
  1. configuration_tinymind.py +28 -0
configuration_tinymind.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TinyMind configuration."""
2
+ from transformers import PretrainedConfig
3
+
4
+
5
+ class TinyMindConfig(PretrainedConfig):
6
+ model_type = "tiny_smart_llm"
7
+
8
+ def __init__(
9
+ self,
10
+ vocab_size: int = 50257,
11
+ n_embd: int = 256,
12
+ n_heads: int = 8,
13
+ n_layers: int = 6,
14
+ max_seq_len: int = 512,
15
+ dropout: float = 0.1,
16
+ **kwargs,
17
+ ):
18
+ self.vocab_size = vocab_size
19
+ self.n_embd = n_embd
20
+ self.n_heads = n_heads
21
+ self.n_layers = n_layers
22
+ self.num_hidden_layers = n_layers # HF generate() expects this
23
+ self.hidden_size = n_embd # HF convention
24
+ self.num_attention_heads = n_heads # HF convention
25
+ self.max_seq_len = max_seq_len
26
+ self.max_position_embeddings = max_seq_len # HF convention
27
+ self.dropout = dropout
28
+ super().__init__(**kwargs)