From ba66edae1d4bbe518a738684b37d4e0228e95fc0 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Wed, 7 Oct 2026 19:13:51 +0800 Subject: [PATCH] fix: DS.__len__ (RandomSampler requires it); exercised on first r8b launch --- train_arabic_r8_hf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/train_arabic_r8_hf.py b/train_arabic_r8_hf.py index 299e095..407f4b0 100644 --- a/train_arabic_r8_hf.py +++ b/train_arabic_r8_hf.py @@ -173,6 +173,9 @@ def add_silver(tgt: str) -> None: tok = AutoTokenizer.from_pretrained(TEACHER) class DS(Dataset): + def __len__(self): + return len(units) + def __getitem__(self, i): src, tgt = units[i] e = tok(src, truncation=True, max_length=WINDOW)