Skip to content

Add xdrope for HunyuanOCR (even though does not seem to improve results) - #281

Merged
vince62s merged 6 commits into
eole-nlp:mainfrom
vince62s:xdrope
Dec 10, 2025
Merged

Add xdrope for HunyuanOCR (even though does not seem to improve results)#281
vince62s merged 6 commits into
eole-nlp:mainfrom
vince62s:xdrope

Conversation

@vince62s

@vince62s vince62s commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

This PR adds support for "xdrope" which hunyuanOCR supposedly uses.
In fact their xdrope is close to mRope used by Qwen VL (we need to revisit when implementing this one)

The big issue is that hunyuanOCR xdrope is broken in both vLLM and HF as of the time of this PR.

batching is not supported in their code
pos_h/pos_w are not properly computed

AND they forgot to build the block diagonal mask when handling multiple images.

This PR fixes all of this BUT I just hope training was done accurately.

Anyway outputs are quite good with and without xdrope.

This comment was marked as outdated.

This comment was marked as outdated.

…code are broken

the position_ids are not computed properly and batch not supported

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eole/models/model.py Outdated
Comment thread eole/models/model.py
Comment thread eole/modules/rope.py Outdated
Comment thread eole/modules/multi_headed_attn.py Outdated
Comment thread eole/models/model.py Outdated
@vince62s
vince62s merged commit 1963f94 into eole-nlp:main Dec 10, 2025
2 checks passed
@vince62s
vince62s deleted the xdrope branch January 2, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants