Skip to content

Commit 00ed529

Browse files
committed
correct assert
1 parent cef3be1 commit 00ed529

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
test:
@@ -33,7 +33,7 @@ jobs:
3333
if [ -f requirements.txt ]; then
3434
pip install -r requirements.txt
3535
else
36-
pip install torch pytest
36+
pip install torch pytest numpy
3737
fi
3838
3939
- name: Run tests

bitnet/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def forward(self, x):
144144

145145
class BitNet(nn.Module):
146146
def __init__(self, vocab_size, d_model, block_size, n_layer, n_head, n_kv_head, ffn_dim):
147-
assert(n_head % n_kv_head == 0, "n_head must be divisible by n_kv_head")
147+
if n_head % n_kv_head != 0: raise ValueError("n_head must be divisible by n_kv_head")
148148
super().__init__()
149149
self.block_size = block_size
150150
self.embed_tokens = nn.Embedding(vocab_size, d_model)

0 commit comments

Comments
 (0)