Repository navigation
ocr: add granite-docling-v2-500m adaptive density router (--route auto|fine|coarse) - #220
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds native support for
ibm-granite/granite-docling-v2-500m's adaptive vision-token density router inocr/granite-docling-v2-saturate.py:config.density_router_hidden_size(no-op on 2B).--route auto|fine|coarse(defaultauto):auto: loads only the vision encoder + router (router.text_model = None) on CUDA alongside vLLM (--trust-request-mm-kwargs --gpu-memory-utilization 0.8), runspredict_fine_routeper page on the resized image, and passesmm_processor_kwargs={"fine_route": bool}per request. Logsroute: mode=auto fine=... coarse=... (% fine)on completion.fine/coarse: forces a fixed 256 or 64 tokens/tile route viamm_processor_kwargswithout loading the client-side router.--route fine|coarseis passed on a non-router checkpoint (e.g. 2B).Validation
rtx-pro-6000, Job6b0f14756c5d61fff193b5e6): 20/20 ok, 0 errors,finish_reasons: {"stop": 20},route: mode=auto fine=2 coarse=18 (10.0% fine).6b0f15df54072e8b71753d28.