Add GPT-2 KV cache to pkg (#687)

This commit is contained in:
Sebastian Raschka
2025-06-21 12:29:04 -05:00
committed by GitHub
parent 3be0f3202a
commit fdc3e1b701
4 changed files with 315 additions and 5 deletions

View File

@@ -113,7 +113,22 @@ from llms_from_scratch.appendix_d import find_highest_gradient, train_model
```
 
### GPT-2 KV cache variant (Bonus material)
```python
from llms_from_scratch.kv_cache.gpt2 import GPTModel
from llms_from_scratch.kv_cache.generate import generate_text_simple
```
For more information about KV caching, please see the [KV cache README](../../ch04/03_kv-cache).
 
### Llama 3 (Bonus material)
```python