Upload src/config.py with huggingface_hub
Browse files- src/config.py +35 -0
src/config.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from dataclasses import dataclass
|
| 2 |
+
|
| 3 |
+
@dataclass
|
| 4 |
+
class NexusConfig:
|
| 5 |
+
vocab_size: int = 50304
|
| 6 |
+
max_seq_len: int = 512
|
| 7 |
+
dim: int = 768
|
| 8 |
+
num_layers: int = 10
|
| 9 |
+
num_heads: int = 12
|
| 10 |
+
num_kv_heads: int = 4
|
| 11 |
+
multiple_of: int = 256
|
| 12 |
+
ff_dim: int = 2048
|
| 13 |
+
norm_eps: float = 1e-6
|
| 14 |
+
dropout: float = 0.0
|
| 15 |
+
|
| 16 |
+
batch_size: int = 4
|
| 17 |
+
gradient_accumulation_steps: int = 8
|
| 18 |
+
learning_rate: float = 3e-4
|
| 19 |
+
min_lr: float = 3e-5
|
| 20 |
+
weight_decay: float = 0.1
|
| 21 |
+
beta1: float = 0.9
|
| 22 |
+
beta2: float = 0.95
|
| 23 |
+
warmup_steps: int = 500
|
| 24 |
+
max_steps: int = 100000
|
| 25 |
+
|
| 26 |
+
rope_theta: float = 500000.0
|
| 27 |
+
|
| 28 |
+
use_flash_attention: bool = True
|
| 29 |
+
|
| 30 |
+
data_path: str = "data"
|
| 31 |
+
save_dir: str = "weights"
|
| 32 |
+
|
| 33 |
+
seed: int = 42
|
| 34 |
+
|
| 35 |
+
nexus_config = NexusConfig()
|