From 65cfc3255f03b5abb528990ae595d0a69b19a2df Mon Sep 17 00:00:00 2001 From: Guitared Date: Tue, 3 Mar 2026 14:11:42 +0700 Subject: [PATCH] optimize singleton token params in generate_text --- training/dashboard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/training/dashboard.py b/training/dashboard.py index a3a1503..ed019ef 100644 --- a/training/dashboard.py +++ b/training/dashboard.py @@ -142,7 +142,7 @@ def softmax(x): e = np.exp(x) return e / np.sum(e) -def generate_text(W, tok, max_tokens=64, temperature=0.8): +def generate_text(W, max_tokens=64, temperature=0.8): tokenizer = get_tokenizer() if tokenizer is None: return '[no tokenizer]' @@ -244,7 +244,7 @@ def generation_thread(): with S.gen_lock: S.gen_status = 'idle' continue - text = generate_text(W, get_tokenizer(), max_tokens=64, temperature=0.8) + text = generate_text(W, max_tokens=64, temperature=0.8) with S.gen_lock: S.gen_text = text S.gen_step = S.step @@ -851,7 +851,7 @@ def main(): try: W = load_weights_from_ckpt(CKPT_PATH) if W: - text = generate_text(W, get_tokenizer(), max_tokens=64, temperature=0.8) + text = generate_text(W, max_tokens=64, temperature=0.8) with S.gen_lock: S.gen_text = text S.gen_step = S.step