nanochat/tests
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
..
test_attention_fallback.py delete autocast, an unnecessary thorn in my side, manage dtypes directly 2026-03-04 23:55:30 +00:00
test_context_truncation.py fix: truncate conversation tokens to model context window in chat_cli 2026-05-06 01:29:20 +05:00
test_engine.py Fix MockModel's device definition (#535) 2026-02-17 16:03:46 -08:00