Skip to content

T5Gemma conversion and inference#1962

Merged
jordimas merged 15 commits intoOpenNMT:masterfrom
jordimas:t5_gemma
Jan 4, 2026
Merged

T5Gemma conversion and inference#1962
jordimas merged 15 commits intoOpenNMT:masterfrom
jordimas:t5_gemma

Conversation

@jordimas
Copy link
Collaborator

@jordimas jordimas commented Dec 29, 2025

See #1946

Python wheels are available to test here:
https://github.com/OpenNMT/CTranslate2/actions/runs/20646214823#artifacts

Changes:

  • Support for T5Gemma family models
  • Extract qk_norm logic to its own method
  • Add support for rotary embeddings and pre and post layers in encoder

@jordimas jordimas mentioned this pull request Dec 29, 2025
@jncraton
Copy link
Contributor

Thanks for your quick work on this!

This looks good in my brief testing. Conversion and inference both appear to function as intended. I tested using t5gemma-s-s-prefixlm-it.

The following input:

[
	"<start_of_turn>", "user", "\n",
	"What", "▁is", "▁the", "▁capital", "▁of", "▁France", "?", "<end_of_turn>", "\n",
	"<start_of_turn>", "model", "\n"
]

Correctly produces this output:

[
	"The", "▁capital", "▁of", "▁France", "▁is", "▁**", "Paris", "**.", "", "\n"
]

@jordimas jordimas merged commit 4ebf2dc into OpenNMT:master Jan 4, 2026
16 checks passed
@jordimas jordimas deleted the t5_gemma branch January 4, 2026 14:34
a2d8a4v pushed a commit to a2d8a4v/CTranslate2 that referenced this pull request Jan 13, 2026
See OpenNMT#1946

Changes:
- Support for T5Gemma family models
- Extract qk_norm logic to its own method
- Add support for rotary embeddings and pre and post layers in encoder
- Support for different types of cross attention and unit tests
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

Comments