Adding support for GraniteDoclingHybrid#44445
Adding support for GraniteDoclingHybrid#44445gabe-l-hart wants to merge 23 commits intohuggingface:mainfrom
Conversation
zucchini-nlp
left a comment
There was a problem hiding this comment.
Nice work! Left a few comments so we are aligned with recent changes in v5, otherwise the PR is in good shape
src/transformers/models/granite_docling_hybrid/configuration_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
src/transformers/models/granite_docling_hybrid/configuration_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
src/transformers/models/granite_docling_hybrid/modular_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
src/transformers/models/granite_docling_hybrid/modular_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
src/transformers/models/granite_docling_hybrid/processing_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
src/transformers/models/granite_docling_hybrid/processing_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
src/transformers/models/granite_docling_hybrid/processing_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
src/transformers/models/granite_docling_hybrid/processing_granite_docling_hybrid.py
Outdated
Show resolved
Hide resolved
| **kwargs, | ||
| ) | ||
|
|
||
| image_seq_len = image_seq_len if image_seq_len is not None else self.image_seq_len |
There was a problem hiding this comment.
am I right that this line is the only diff from Idefics3? If yes, I'd prefer to just copy completely from ideifcs because making image_seq_len an arg isn't very useful
There was a problem hiding this comment.
The real diff is below where the GotOcr2 logic is swapped for the Idefics3 logic. I think this may be one of the TBD architectural decisions, so if the team decides to switch back to Idefics3, this ould all go away.
f2b4745 to
a16c63c
Compare
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This is untested, but passes code generation correctly now Branch: GraniteDoclingHybrid AI-usage: draft (IBM Bob) Signed-off-by: Gabe Goodhart <ghart@us.ibm.com> Co-authored-by: omenetti.matteo@gmail.com Co-authored-by: nassarofficial@gmail.com
Branch: GraniteDoclingHybrid AI-usage: full (IBM Bob) Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
…s after v5 rebase Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
This was getting injected in Idefics3ProcessorKwargs and causing errors since it's not a valid kwarg in the base ImageProcessorKwargs and somehow that's what was being validated against (versus Idefics3ImageProcessorKwargs) Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
This all lives in `prepare_inputs_for_generation` Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
This was recommended in review. Also, there was already a bug where self.image_seq_len was being used for the real computation, so this kwarg was never fully supported. Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteDoclingHybrid AI-usage: none Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
1bf67fb to
f82599a
Compare
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto |
What does this PR do?
This PR adds support for the forthcoming Granite Docling model based on the Granite 4 LLM architecture (
GraniteMoeHybrid).Draft Status
This PR is in draft pending the possibility of some additional changes:
GraniteDoclingHybrid(versus egGraniteMoeHybridDoclingor similar)Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Models: