Downloads · 30 days
0
Menterium/translategemma-4b-it-onnx-int4-dml
translategemma-4b-it-onnx-int4-dml is a translation model from Menterium. Use it when you need text moved from one language to another. The card lists the license as gemma.
ONNX Runtime GenAI build (int4 weights, fp16 activations, DirectML execution provider) of the text component of google/translategemma-4b-it, Google's translation-specialized Gemma 3 model covering 55 languages.
Downloads · 30 days
0
Access
Public
Updated Oct 26, 2026
Repo size
3.7 GB
Likes
0
Public
Click a slice to open those files.
.data3.7 GB · 99%
From the Hugging Face model README
ONNX Runtime GenAI build (int4 weights, fp16 activations, DirectML execution provider) of the text component of google/translategemma-4b-it, Google's translation-specialized Gemma 3 model covering 55 languages.
Built for local, fully offline translation in
Celerando (Menterium IT Solutions GmbH); usable with any
onnxruntime-genai client on
DirectX-12-capable GPUs, within the 1024-token limit described below. A CPU variant is published separately as
translategemma-4b-it-onnx-int4-cpu.
On DirectML, keep prompt + generated tokens ≤ 1024.
The DirectML kernel of GroupQueryAttention in ONNX Runtime does not apply the
local_window_size attribute (checked in v1.24.4, v1.31.0 and main). Gemma 3 uses a
1024-token sliding window in its local attention layers, 29 of the 34 layers of this model.
Beyond position 1024 these layers attend to tokens outside their window, and the model
falls into repetition loops (for example 20,20,20,… on tables of figures) or ends a
translation early and silently drops lines. In an isolated operator test with 1026
tokens and a window of 1024, the CPU kernel ignores a value outside the window
(output 0.0), the DirectML kernel does not (output 0.998).
What a client should do on DirectML:
max_length to at most 1024,The CPU execution provider applies the window correctly; the limit does not exist
there (translategemma-4b-it-onnx-int4-cpu is not affected).
Gemma3ForCausalLM, model type gemma3_text); the vision tower is not included.python -m onnxruntime_genai.models.builder -p int4 -e dml).genai_config.json ships with eos_token_id: [1, 106] so that
<end_of_turn> terminates generation (the stock config only stopped on <eos>).Gemma requires the <bos> token at the start of the prompt — without it the
output degenerates. The tokenizer of onnxruntime-genai does not add it
automatically:
<bos><start_of_turn>user
Translate the following text into English. Reply with ONLY the translation.
Text:
Wie heißt die Hauptstadt von Frankreich?<end_of_turn>
<start_of_turn>model
Gemma is provided under and subject to the Gemma Terms of Use found at
ai.google.dev/gemma/terms (see also NOTICE; a copy of
the Gemma Terms of Use and the Gemma Prohibited Use Policy is included as
GEMMA_TERMS_OF_USE.txt). Use of this
model is also subject to the
Gemma Prohibited Use Policy.
This repository redistributes a quantized derivative of TranslateGemma; all
rights in the underlying model remain with Google.