Skip to content

T5Gemma conversion and inference - #1962

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

jordimas merged 15 commits into
OpenNMT:masterfrom
jordimas:t5_gemma

Conversation

@jordimas

@jordimas jordimas commented Dec 29, 2025 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Lanurence666 pushed a commit to Lanurence666/CTranslate2_backport_py38 that referenced this pull request May 23, 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
veilnetwork pushed a commit to veilnetwork/CTranslate2 that referenced this pull request Aug 27, 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