-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
28 lines (25 loc) · 682 Bytes
/
config.py
File metadata and controls
28 lines (25 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from dataclasses import dataclass
@dataclass
class MoeConfig:
def __init__(self, hidden_dim, expert_num, topk, shared_expert_num=2):
self.hidden_dim = hidden_dim
self.expert_num = expert_num
self.topk = topk
self.shared_expert_num = shared_expert_num
@dataclass
class DistConfig:
world_size: int = 1
backend: str = "nccl"
device = None
capacity_factor = 0.5
@dataclass
class LlamaConfig:
max_seq: int = 512
batch_size: int = 12
n_layer: int = 12
n_head: int = 12
hidden_dim: int = 768
dropout: float = 0.1
head_size: int = hidden_dim // n_head
# vocab_size: int = 50257
vocab_size: int = 768