Downloads · 30 days
27
42% of all-time downloads
Tonic/GemmaX2-28-2B-8bit
GemmaX2-28-2B-8bit is a translation model from Tonic. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as apache-2.0.
GemmaX2-28-2B GGUF Quantizations are a set of quantized variants of GemmaX2-28-2B-v0.1, an LLM-based translation model developed by Xiaomi. The original model was finetuned from GemmaX2-28-2B-Pretrain, which itself is…
Downloads · 30 days
27
42% of all-time downloads
All-time downloads
64
Public
Parameters
2.6B
3.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors3.2 GB · 99%
How the weights are stored.
I82B · 77%
From the Hugging Face model README
GemmaX2-28-2B GGUF Quantizations are a set of quantized variants of GemmaX2-28-2B-v0.1, an LLM-based translation model developed by Xiaomi. The original model was finetuned from GemmaX2-28-2B-Pretrain, which itself is a continually pretrained version of Gemma2-2B using a diverse dataset of 56 billion tokens across 28 languages. These GGUF versions (f16, bf16, q8_0, tq1_0, tq2_0) were created to optimize the model for efficient inference on resource-constrained environments while preserving translation capabilities.
f16 (16-bit float), bf16 (bfloat16), q8_0 (8-bit quantization), tq1_0 (ternary quantization 1), tq2_0 (ternary quantization 2)GemmaX2-28-2B-v0.1 is designed for multilingual machine translation, built on GemmaX2-28-2B-Pretrain, which was pretrained on a mix of monolingual and parallel data (56 billion tokens) across 28 languages. The finetuning process used a small, high-quality set of translation instruction data to enhance its performance. These GGUF quantizations were generated using convert_hf_to_gguf.py, converting the original Hugging Face model into formats compatible with tools like llama.cpp for efficient deployment.
ModelSpace/GemmaX2-28-2B-v0.1convert_hf_to_gguf.pyf16: 16-bit floating-point, minimal precision loss, larger file size (~5-7GB).bf16: Brain floating-point 16-bit, optimized for certain hardware (e.g., TPUs), similar size to f16.q8_0: 8-bit quantization, reduced size (~3-4GB), slight precision trade-off.tq1_0: Ternary quantization (1-bit), smallest size (~1-2GB), higher precision loss.tq2_0: Ternary quantization (2-bit variant), slightly larger than tq1_0, balanced size vs. quality.These quantized models are intended for:
llama.cpp).The original GemmaX2-28-2B-v0.1 model’s performance is detailed in the paper Multilingual Machine Translation with Open Large Language Models at Practical Scale: An Empirical Study. Quantization introduces varying degrees of performance trade-offs:
f16 and bf16: Near-identical to the original model’s accuracy, with minimal degradation.q8_0: Slight reduction in translation quality, still suitable for most practical applications.tq1_0 and tq2_0: Noticeable quality loss, best for scenarios prioritizing speed and size over precision.Exact metrics depend on the downstream task and dataset; users are encouraged to evaluate performance for their specific use case.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "ModelSpace/GemmaX2-28-2B-v0.1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
text = "Translate this from Chinese to English:\nChinese: 我爱机器翻译\nEnglish:"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Download a GGUF file from Tonic/GemmaX2-28-2B-gguf and use it with a GGUF-compatible inference tool like llama.cpp:
# Example with llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
make
# Run inference with q8_0 model
./main -m gemmax2-28-2b-q8_0.gguf -p "Translate from Chinese to English: 我爱机器翻译"
Available files:
gemmax2-28-2b-f16.ggufgemmax2-28-2b-bf16.ggufgemmax2-28-2b-q8_0.ggufgemmax2-28-2b-tq1_0.ggufgemmax2-28-2b-tq2_0.gguftq1_0, tq2_0) may degrade translation quality, especially for complex sentences or rare language pairs.bf16 benefits from specific hardware support (e.g., NVIDIA Ampere GPUs, TPUs); performance may vary otherwise.GemmaX2-28-2B’s translation capabilities, which may not be reflected in these quantized versions until updated.For the original model:
@misc{cui2025multilingualmachinetranslationopen,
title={Multilingual Machine Translation with Open Large Language Models at Practical Scale: An Empirical Study},
author={Menglong Cui and Pengzhi Gao and Wei Liu and Jian Luan and Bin Wang},
year={2025},
eprint={2502.02481},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2502.02481},
}
For these quantized versions, please also credit:
For questions about the original model, refer to Xiaomi’s publication. For issues with the GGUF quantizations, contact Tonic via Hugging Face discussions at Tonic/GemmaX2-28-2B-gguf.