Skip to content

Conversation

@dmunch
Copy link

@dmunch dmunch commented Nov 12, 2025

Proposed changes

Adding support for EmbeddingGemma to Embedders.

Basically cherry-picked all commits from ml-explore/mlx-swift-examples#398 from to the new repository, made sure everything compiles and ran swift-format.

Pretty new to MLX, and thought that would be a good learning opportunity and try to get something in. Let me know what kind of modifications etc. you'd still like to have to get this merged.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

dmunch and others added 10 commits November 12, 2025 17:20
Cherry-Pick of 86bb1265168363cc5096b8df5f82075a5702ef2e
Co-authored-by: Tom Nickson <tnickson@apple.com>
Cherry-Pick of d44e2c3d6d5365655aa0e179432cf3548ecd17d4
Co-authored-by: Tom Nickson <tnickson@apple.com>
- Add useBidirectionalAttention config parameter
- Apply sliding window size adjustment for bidirectional mode
- Implement createBidirectionalSlidingWindowMask function
- Update mask creation logic to support both causal and bidirectional attention
- Based on patches 40694 and 40700 for EmbeddingGemma support

Cherry-Picked
Commit: 46be017e9f4b076f2d0842cf78175ac42d894b0a
Co-authored-by: Tom Nickson <tnickson@apple.com>
Cherry-Picked
Commit: 8dc179ccc21b26fb0856016ec9f2b7d5792979e0
Co-authored-by: Tom Nickson <tnickson@apple.com>
Commit: 733e142542cfaf85ca0304d37f908b176c54edfc
Co-authored-by: Tom Nickson <tnickson@apple.com>
Commit: 96ee882cd7c6fd3573b034686d3f3c5afe1ee04a
Co-authored-by: Tom Nickson <tnickson@apple.com>
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.

1 participant