MCPcopy
hub / github.com/karpathy/nanochat / decode

Method decode

tests/test_engine.py:79–82  ·  view source on GitHub ↗
(self, tokens)

Source from the content-addressed store, hash-verified

77 return tokens
78
79 def decode(self, tokens):
80 # Filter out special tokens before decoding
81 byte_tokens = [t for t in tokens if t < 256]
82 return bytes(byte_tokens).decode("utf-8", errors="replace")
83
84def test_kv_cache_basic():
85 """Test basic KVCache functionality for FA3."""

Callers 11

tok_train.pyFile · 0.45
run_generative_evalFunction · 0.45
get_batchFunction · 0.45
run_gsm8k_evalFunction · 0.45
base_train.pyFile · 0.45
get_hf_token_bytesFunction · 0.45
mainFunction · 0.45
generate_streamFunction · 0.45
tok_eval.pyFile · 0.45
chat_cli.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected