Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
src/collate_deepseek.py:
- Letterbox-pads images to 768×768 (gray fill, mean=0.5), normalizes
- Inserts 145 image tokens (12²+1) at sequence start
- Masks image+prompt prefix with -100; trains on response+EOS only
- Builds images_seq_mask and images_spatial_crop for forward()
- crop_mode=False: single global view, same tensor for both tuple slots
(TODO: validate images tuple format against model source)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CROHME, MathWriting, and typeset_train manifests store bare math expressions.
Since images render as display math ($ expr $), training targets should be
valid Typst -- wrap at load_records() via _MATH_ONLY_SPLITS set rather than
touching manifests. Mixed splits already contain full body content.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>