Skip to content

Commit 76bce0c

Browse files
author
Ronald Tse
committed
style: ruff clean (unused import, line length, zip strict)
1 parent 6473dad commit 76bce0c

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

‎src/gpu/modal_golden_matrix.py‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,31 @@
3939

4040
# index id -> volume zip path + test pairs (volume-relative)
4141
SOURCES = {
42-
"khm-latn-1.0": ("imf/khm-latn/khm-latn-1.0-fp32.zip", "/secryst-datasets/khmer-translit/test.jsonl"),
42+
"khm-latn-1.0":
43+
("imf/khm-latn/khm-latn-1.0-fp32.zip",
44+
"/secryst-datasets/khmer-translit/test.jsonl"),
4345
"urd-g2p-1.0": ("imf/urd-g2p/urd-g2p-1.0-fp32.zip", "/ud-g2p/urdu-g2p/test.jsonl"),
4446
"urd-diac-1.0": ("imf/urd-diac/urd-diac-1.0-fp32.zip", "/ud-diacrit/urdu-diacrit/test.jsonl"),
45-
"tha-g2p-base-1.0": ("imf/tha-g2p-base/tha-g2p-base-1.0-fp32.zip", "/secryst-datasets/thai-ipa/test.jsonl"),
46-
"tha-g2p-small-1.0": ("imf/tha-g2p-small/tha-g2p-small-1.0-int8.zip", "/secryst-datasets/thai-ipa/test.jsonl"),
47+
"tha-g2p-base-1.0":
48+
("imf/tha-g2p-base/tha-g2p-base-1.0-fp32.zip",
49+
"/secryst-datasets/thai-ipa/test.jsonl"),
50+
"tha-g2p-small-1.0":
51+
("imf/tha-g2p-small/tha-g2p-small-1.0-int8.zip",
52+
"/secryst-datasets/thai-ipa/test.jsonl"),
4753
"fas-g2p-1.0": ("imf/fas-g2p/fas-g2p-1.0-fp32.zip", "/persian/persian-g2p/test.jsonl"),
4854
"heb-diac-1.0": ("imf/heb-diac/heb-diac-1.0-fp32.zip", "nakdimon/test-imf.jsonl"),
4955
"heb-diac-1.1": ("imf/heb-diac/heb.zip", "nakdimon/test-imf.jsonl"),
50-
"heb-diac-small-1.0": ("imf/heb-diac-small/heb-diac-small-1.0-fp32.zip", "nakdimon/test-imf.jsonl"),
56+
"heb-diac-small-1.0":
57+
("imf/heb-diac-small/heb-diac-small-1.0-fp32.zip",
58+
"nakdimon/test-imf.jsonl"),
5159
"ara-diac-1.0": ("imf/ara-diac/ara-diac-1.0-fp32.zip", "arabic-sadeed-imf/test.jsonl"),
5260
"ara-diac-2.0-int8": ("imf/ara-diac2/ara-diac-2.0-int8.zip", "arabic-sadeed-imf/test.jsonl"),
53-
"ara-diac-small-2.1-int8": ("imf/ara-diac-small-21/ara-diac-small-2.1-int8.zip", "arabic-sadeed-imf/test.jsonl"),
54-
"ara-diac-layerdrop-1.0-int4": ("imf/ara-diac-layerdrop/ara-diac-layerdrop-1.0-int4.zip", "arabic-sadeed-imf/test.jsonl"),
61+
"ara-diac-small-2.1-int8":
62+
("imf/ara-diac-small-21/ara-diac-small-2.1-int8.zip",
63+
"arabic-sadeed-imf/test.jsonl"),
64+
"ara-diac-layerdrop-1.0-int4":
65+
("imf/ara-diac-layerdrop/ara-diac-layerdrop-1.0-int4.zip",
66+
"arabic-sadeed-imf/test.jsonl"),
5567
}
5668

5769

‎src/gpu/modal_teacher_sadeed.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def teacher_preds() -> dict:
5353
import sys
5454

5555
import pyarrow.parquet as pq
56-
import torch
5756
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
5857

5958
# Modal copies the entry file to /root/<name>.py while the repo

‎tests/test_muon_headwise.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_headwise_equals_per_slice_vanilla() -> None:
4343
hw.step()
4444

4545
vanilla = Muon(slices, lr=0.01, momentum=0.95)
46-
for p, g in zip(slices, slice_grads):
46+
for p, g in zip(slices, slice_grads, strict=True):
4747
p.grad = g.clone()
4848
vanilla.step()
4949

@@ -114,7 +114,8 @@ def test_split_parameters_unchanged_when_headwise_unused() -> None:
114114
group kind, it does not touch the default split."""
115115
named = [
116116
("shared.weight", torch.zeros(3, 4, requires_grad=True)),
117-
("encoder.block.0.layer.1.DenseReluDense.wi_0.weight", torch.zeros(4, 3, requires_grad=True)),
117+
("encoder.block.0.layer.1.DenseReluDense.wi_0.weight",
118+
torch.zeros(4, 3, requires_grad=True)),
118119
("encoder.block.0.layer.0.layer_norm.weight", torch.zeros(3, requires_grad=True)),
119120
]
120121
muon, adamw = split_parameters(named)

0 commit comments

Comments
 (0)