README: keep maxTokens at 1933 or below (the decoder's 2048-position KV cache)
Browse files
README.md
CHANGED
|
@@ -134,6 +134,7 @@ The exact, verified recipe is in `assets/recipe.json`. Reference implementations
|
|
| 134 |
roughly square or portrait, with text still legible when fit to 640². Very dense small-text scans
|
| 135 |
(newspaper) want the tiled `crop_mode` vision export (not included here; Base mode only).
|
| 136 |
- Prompt is fixed to `document parsing` (layout + structured extraction).
|
|
|
|
| 137 |
- License: **MIT** (inherited from `baidu/Unlimited-OCR`).
|
| 138 |
|
| 139 |
*Community port — not affiliated with Apple or baidu.*
|
|
|
|
| 134 |
roughly square or portrait, with text still legible when fit to 640². Very dense small-text scans
|
| 135 |
(newspaper) want the tiled `crop_mode` vision export (not included here; Base mode only).
|
| 136 |
- Prompt is fixed to `document parsing` (layout + structured extraction).
|
| 137 |
+
- Keep the `maxTokens` of `KitDocReader.read(imageAt:maxTokens:)` at 1933 or below; the default of 1024, which `CoreAI.read` uses, fits. The decoder has a fixed KV cache of 2048 positions, shared by the image prompt (115 positions) and the generated tokens (one each), and a page that needs more tokens than `maxTokens` is cut there. CoreAIKit 0.7.3 and earlier do not stop at the end of the cache, and what they output past it has not been checked.
|
| 138 |
- License: **MIT** (inherited from `baidu/Unlimited-OCR`).
|
| 139 |
|
| 140 |
*Community port — not affiliated with Apple or baidu.*
|