Skip to content

Conversation

RyanMullins
Copy link
Contributor

@RyanMullins RyanMullins commented Sep 4, 2025

What does this PR do?

Adds support for embedding model use cases to Gemma 3.

  • Adds use_bidirectional_attention config flag
  • Adds _bidirectional_window_overlay() for local sliding attention
  • Adds relevant or_mask functions
  • Updates weights conversion script with entries for EmbeddingGemma and Gemma 3 270M

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker @Cyrilvallez

@RyanMullins RyanMullins changed the title EmbeddingGemma add: embedding model Sep 4, 2025
Copy link
Contributor

github-actions bot commented Sep 4, 2025

[For maintainers] Suggested jobs to run (before merge)

run-slow: gemma3

Copy link
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot! 🤗

@Cyrilvallez Cyrilvallez merged commit 87f38db into huggingface:main Sep 4, 2025
17 checks passed
@HuggingFaceDocBuilderDev

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.

@ArthurZucker
Copy link
Collaborator

Ty both! 🤗

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.

5 participants