nanochat/scripts
rehman 09bdfd6628 fix: truncate conversation tokens to model context window in chat_cli
Fixes #581. When conversation_tokens grows beyond model.config.sequence_len,
engine.generate() received a zero-dimension tensor and crashed with a matmul
shape error. Add a sliding window guard before each generate() call that keeps
the most recent (sequence_len - max_new_tokens) tokens, re-inserts bos to
preserve a well-formed sequence, and notifies the user when truncation occurs.
2026-05-06 01:29:20 +05:00
..
base_eval.py delete autocast, an unnecessary thorn in my side, manage dtypes directly 2026-03-04 23:55:30 +00:00
base_train.py fix: use meta device in disable_fp8 to avoid VRAM spike (#616) 2026-03-25 14:24:57 -07:00
chat_cli.py fix: truncate conversation tokens to model context window in chat_cli 2026-05-06 01:29:20 +05:00
chat_eval.py delete autocast, an unnecessary thorn in my side, manage dtypes directly 2026-03-04 23:55:30 +00:00
chat_rl.py delete autocast, an unnecessary thorn in my side, manage dtypes directly 2026-03-04 23:55:30 +00:00
chat_sft.py Merge pull request #634 from 2bitbit/fix-docs-and-comments 2026-03-25 14:31:49 -07:00
chat_web.py delete autocast, an unnecessary thorn in my side, manage dtypes directly 2026-03-04 23:55:30 +00:00
tok_eval.py initial commit 2025-10-13 06:49:24 -07:00
tok_train.py fix: correct minor typos in help text, README, and comments 2026-03-12 17:03:26 +08:00