Logo

EraX-Translator-V1.0: A Compact and Capable Multilingual Translation Model

EraX-Translator-V1.0 is a compact, Gemma3-4B-based multilingual translation model designed for efficient deployment and high throughput, even on resource-constrained hardware. We aim to provide a practical tool for a wide range of translation tasks, with a particular focus on languages where high-quality data and models are less readily available.

Model Description

This model leverages the architectural strengths of the Gemma3-4B foundation model (4 trillion tokens, 140 languages pretrained) and has been fine-tuned for translation across a diverse set of languages. A key feature is its ability to translate Classical Chinese, demonstrating potential utility in translating Buddhist texts and other historical documents.

Key features:

  • Compact Size: Based on the Gemma3-4B architecture, the model can be efficiently deployed on devices with limited resources.
  • High Throughput: Achieves approximately 80 tokens/s (bfloat16) using vLLM with ~20GB VRAM. Potential for >100 tokens/s with GGUF 6bit quantization on better GPU (though optimal llama.cpp support for Gemma3 is still under development).

vLLM speed

EraX Translator V1.0 with vLLM

  • Multilingual: Trained on a diverse dataset to support translation between - bidirectional multiple languages.

    • Viแป‡t Nam ๐Ÿ‡ป๐Ÿ‡ณ
    • English ๐Ÿ‡ฌ๐Ÿ‡ง / ๐Ÿ‡บ๐Ÿ‡ธ
    • Chinese ๐Ÿ‡จ๐Ÿ‡ณ
    • Cantonese ๐Ÿ‡จ๐Ÿ‡ณ / ๐Ÿ‡ญ๐Ÿ‡ฐ
    • Ancient Chinese (Cแป• Vฤƒn Trung Hoa ๅคๅ…ธๆ–‡ๅญธ, Kinh Phแบญt cแป• ๅคไฝ›็ถ“) ๐Ÿ‡จ๐Ÿ‡ณ ๐Ÿ“œ
    • Russian ๐Ÿ‡ท๐Ÿ‡บ
    • Ukrainian ๐Ÿ‡บ๐Ÿ‡ฆ
    • French ๐Ÿ‡ซ๐Ÿ‡ท
    • German ๐Ÿ‡ฉ๐Ÿ‡ช
    • Dutch ๐Ÿ‡ณ๐Ÿ‡ฑ
    • Korean ๐Ÿ‡ฐ๐Ÿ‡ท
    • Japanese ๐Ÿ‡ฏ๐Ÿ‡ต
    • Hindi ๐Ÿ‡ฎ๐Ÿ‡ณ
  • Classical Chinese Translation: Demonstrates proficiency in translating Classical Chinese, particularly Buddhist texts.

Intended Uses

This model is intended for:

  • General-purpose multilingual translation.
  • Translation of Classical Chinese texts, particularly those related to Buddhism.
  • Research and experimentation in low-resource machine translation.
  • Deployment in applications where computational resources are limited.
  • Overcome Google Translate suboptimal quality

Training Data & Training Strategy:

The model was trained on approximately 8 million multilingual samples. This data includes:

  • Publicly available translation datasets.
  • Datasets from public Hugging Face repositories.
  • A substantial portion of the training data was synthetically generated using Gemmini.
  • A significant contribution of 15,000 samples of translated Buddhist texts from Classical Chinese to Vietnamese, generously provided by experts in Han-Nom from the Trแบงn Nhรขn Tรดng Institute, Vietnam National University, Hanoi. We are deeply grateful for their invaluable contribution.
  • To optimize the efficiency and performance of EraX-Translator-V1.0, we explored selective parameter freezing rather than employing Low-Rank Adaptation (LoRA), which yielded suboptimal results in preliminary experiments. Guided by the Signal-to-Noise Ratio (SNR) metric proposed in [SNR paper: https://arxiv.org/pdf/2406.06623], we identified the most salient layers within the Gemma3-4B architecture for retention. Specifically, we computed the SNR for each layer, excluding the vision_tower module and the feedforward network layers fc1 and fc2. We then selectively retained the 50% of layers exhibiting the highest SNR values, including embed_tokens layer, and freezing the remaining parameters. This methodology resulted in a significant improvement in translation quality compared to LoRA-based fine-tuning, suggesting that targeted parameter retention based on SNR is an effective strategy for resource-efficient adaptation of large language models for translation tasks.
  • The model underwent training for 2 epochs with a global batch size of 384. Training was performed on a distributed system comprised of 4 NVIDIA H100 NVL GPUs, each equipped with 94 GB of memory.

Evaluation

While comprehensive evaluation is ongoing, preliminary results indicate strong performance in a variety of translation tasks. We are actively working to benchmark the model against established translation models and will release detailed evaluation metrics as soon as they are available. We encourage the community to contribute to the evaluation process.

Known Limitations:

  • As with any machine translation model, EraX-Translator-V1.0 may produce errors or generate translations that are not entirely accurate or fluent.
  • Performance may vary depending on the specific language pair and the complexity of the text being translated.
  • While the model shows promise in translating Classical Chinese, further refinement may be necessary to achieve optimal results.
  • This model can only be used for translation
  • This model was not trained for translating math LaTeX & coding
  • The model works best for context length (text to be translated mostly) not exceeding 1024 tokens or ++800 Vietnamese words (1 A4 page) in one go !

Usage

Here's a few examples:

  • English โ†’ Viแป‡t & French:
โ€œChina and the US are now direct rivals in reshaping the international trade order,โ€ said another, Ju Jiandong, a professor at the Peopleโ€™s Bank of China School of Finance of Tsinghua University. โ€œWeโ€™re willing to take on the challenge โ€“ weโ€™re ready to compete with the US in redefining the new global trade system.โ€. Chinaโ€™s trade partners are likely to take such messaging with a grain of salt.
Beijing is well known to have wielded access to its massive market as a weapon to coerce countries, often over political stances that sparked Beijingโ€™s ire. Many will also be looking warily at whether Chinese exports will flood their own markets, hurting their own domestic production or driving down consumer prices.
But countries may have little choice but to look to strengthen ties with China if US tariffs, which hit American allies as well as rivals, become the new normal.
Beijing over the past month held economic talks with Japan and South Korea, hit last week with 24% and 25% tariffs respectively, as well as with the European Union, which was slapped with 20% duties.
Many Southeast Asian economies โ€“ key manufacturing hubs for companies looking to diversify away from China โ€“ have been hit particularly hard by Trumpโ€™s tariff war. While few want to pick a fight with Washington publicly, the region is rattled.

โ†’ Viแป‡t Nam: "Trung Quแป‘c vร  Mแปน hiแป‡n lร  cรกc ฤ‘แป‘i thแปง trแปฑc tiแบฟp trong viแป‡c ฤ‘แป‹nh hรฌnh lแบกi trแบญt tแปฑ thฦฐฦกng mแบกi quแป‘c tแบฟ", mแป™t ngฦฐแปi khรกc, Ju Jiandong, giรกo sฦฐ tแบกi Trฦฐแปng Tร i chรญnh Ngรขn hร ng Nhรขn dรขn cแปงa ฤแบกi hแปc Thanh Hoa, nรณi. "Chรบng tรดi sแบตn sร ng chแบฅp nhแบญn thแปญ thรกch - chรบng tรดi ฤ‘รฃ sแบตn sร ng cแบกnh tranh vแป›i Mแปน trong viแป‡c xรกc ฤ‘แป‹nh lแบกi hแป‡ thแป‘ng thฦฐฦกng mแบกi toร n cแบงu mแป›i.". 
Cรกc ฤ‘แป‘i tรกc thฦฐฦกng mแบกi cแปงa Trung Quแป‘c cรณ thแปƒ sแบฝ xem nhแบน thรดng ฤ‘iแป‡p nhฦฐ vแบญy. Bแบฏc Kinh nแป•i tiแบฟng lร  ฤ‘รฃ sแปญ dแปฅng quyแปn tiแบฟp cแบญn thแป‹ trฦฐแปng khแป•ng lแป“ cแปงa mรฌnh nhฦฐ mแป™t vลฉ khรญ ฤ‘แปƒ รฉp buแป™c cรกc nฦฐแป›c, thฦฐแปng lร  vรฌ lแบญp trฦฐแปng chรญnh trแป‹ gรขy phแบซn nแป™ แปŸ Bแบฏc Kinh. Nhiแปu ngฦฐแปi cลฉng sแบฝ cแบฃnh giรกc vแป viแป‡c liแป‡u hร ng xuแบฅt khแบฉu cแปงa Trung Quแป‘c cรณ lร m trร n ngแบญp thแป‹ trฦฐแปng cแปงa hแป, แบฃnh hฦฐแปŸng ฤ‘แบฟn sแบฃn xuแบฅt trong nฦฐแป›c cแปงa hแป hay ฤ‘แบฉy giรก tiรชu dรนng xuแป‘ng hay khรดng.
Nhฦฐng cรกc quแป‘c gia cรณ thแปƒ รญt cรณ lแปฑa chแปn nร o khรกc ngoร i viแป‡c tรฌm cรกch tฤƒng cฦฐแปng quan hแป‡ vแป›i Trung Quแป‘c nแบฟu thuแบฟ quan cแปงa Mแปน, รกp dแปฅng cho cรกc ฤ‘แป“ng minh cลฉng nhฦฐ ฤ‘แป‘i thแปง cแปงa Mแปน, trแปŸ thร nh xu hฦฐแป›ng mแป›i. Bแบฏc Kinh trong thรกng qua ฤ‘รฃ tแป• chแปฉc cรกc cuแป™c ฤ‘ร m phรกn kinh tแบฟ vแป›i Nhแบญt Bแบฃn vร  Hร n Quแป‘c, ฤ‘แบกt mแปฉc 24% vร  25% mแปฉc thuแบฟ tฦฐฦกng แปฉng vร o tuแบงn trฦฐแป›c, cลฉng nhฦฐ vแป›i Liรชn minh chรขu ร‚u, vแป‘n ฤ‘รฃ รกp thuแบฟ 20%. Nhiแปu nแปn kinh tแบฟ ฤรดng Nam ร - trung tรขm sแบฃn xuแบฅt quan trแปng cแปงa cรกc cรดng ty ฤ‘ang tรฌm cรกch ฤ‘a dแบกng hรณa khแปi Trung Quแป‘c - ฤ‘รฃ bแป‹ แบฃnh hฦฐแปŸng ฤ‘แบทc biแป‡t nแบทng nแป bแปŸi cuแป™c chiแบฟn thuแบฟ quan cแปงa Trump.
Trong khi mแป™t sแป‘ รญt muแป‘n cรดng khai gรขy chiแบฟn vแป›i Washington, khu vแปฑc nร y ฤ‘ang bแป‘i rแป‘i.

โ†’ French: "La Chine et les ร‰tats-Unis sont maintenant des rivaux directs dans le remodelage de l'ordre commercial international," a dรฉclarรฉ un autre, Ju Jiandong, professeur ร  la Banque populaire de Chine, ร‰cole des finances de l'Universitรฉ Tsinghua. "Nous sommes prรชts ร  relever le dรฉfi - nous sommes prรชts ร  concourir avec les ร‰tats-Unis pour redรฉfinir le nouveau systรจme commercial mondial."
Les partenaires commerciaux de la Chine ont probablement pris un message de cette maniรจre avec un grain de sel.
Pรฉkin est bien connu pour avoir utilisรฉ son accรจs ร  son marchรฉ vaste comme un moyen de coercition pour les pays, souvent sur des positions politiques qui ont provoquรฉ l'indignation de Pรฉkin. Beaucoup d'entre eux s'examineront รฉgalement attentivement pour voir si les exportations chinoises inonderont leurs propres marchรฉs, en nuisiraient ร  leur production domestique ou en feraient baisser les prix ร  la consommation.
Mais les pays pourraient avoir peu de choix que de chercher ร  renforcer les liens avec la Chine si les tarifs amรฉricains, qui touchent aussi bien les alliรฉs qu'les rivaux amรฉricains, deviennent la nouvelle norme.
Pรฉkin a tenu le mois dernier des nรฉgociations รฉconomiques avec le Japon et la Corรฉe du Sud, respectivement frappรฉs en semaine derniรจre par des tarifs de 24 % et 25 %, ainsi que avec l'Union europรฉenne, qui a รฉtรฉ frappรฉe par des droits de douane de 20 %.
Nombre d'รฉconomies d'Asie du Sud-Est โ€“ principaux centres de fabrication pour les entreprises cherchant ร  diversifier en dehors de la Chine โ€“ ont รฉtรฉ particuliรจrement durement touchรฉes par la guerre tarifaire de Trump. Bien que peu aient voulu engager un combat public avec Washington, la rรฉgion est en proie au tumulte. 
  • Viแป‡t โ†’ Russian
ฤแป‘i vแป›i Mแปน, Viแป‡t Nam lร  nฦฐแป›c xuแบฅt siรชu lแป›n thแปฉ ba. Hฦกn nแปฏa, dฦฐแป›i mแบฏt cแปงa Mแปน, Viแป‡t Nam lร  nฦฐแป›c trung chuyแปƒn hร ng cรดng nghiแป‡p xuแบฅt tแปซ Trung Quแป‘c vรฌ hร ng cรดng nghiแป‡p xuแบฅt khแบฉu cแปงa Viแป‡t Nam cรณ hร m lฦฐแปฃng nhแบญp khแบฉu hร ng sฦก chแบฟ, linh kiแป‡n vร  nhiแปu sแบฃn phแบฉm trung gian khรกc tแปซ Trung Quแป‘c rแบฅt cao. Ngoร i ra, tแปซ khi Mแปน cรณ chรญnh sรกch รกp thuแบฟ vร  kiแปm chแบฟ Trung Quแป‘c (tแปซ 2018), ฤ‘แบงu tฦฐ trแปฑc tiแบฟp (FDI) cแปงa Trung Quแป‘c sang Viแป‡t Nam ngร y cร ng nhiแปu.

โ†’ ะกะจะ ัะฒะปััŽั‚ัั ั‚ั€ะตั‚ัŒะธะผ ะฟะพ ะฒะตะปะธั‡ะธะฝะต ัะบัะฟะพั€ั‚ะตั€ะพะผ ะฒ ะ’ัŒะตั‚ะฝะฐะผ. ะšั€ะพะผะต ั‚ะพะณะพ, ะฒ ะกะจะ ะ’ัŒะตั‚ะฝะฐะผ ั€ะฐััะผะฐั‚ั€ะธะฒะฐะตั‚ัั ะบะฐะบ ัั‚ั€ะฐะฝะฐ ะบะพะฝะฒะตั€ั‚ะฐั†ะธะธ ัะบัะฟะพั€ั‚ะฝั‹ั… ั‚ะพะฒะฐั€ะพะฒ ะธะท ะšะธั‚ะฐั, ะฟะพัะบะพะปัŒะบัƒ ะดะพะปั ะธะผะฟะพั€ั‚ะฐ ัั‹ั€ัŒั, ะฟะพะปัƒั„ะฐะฑั€ะธะบะฐั‚ะพะฒ ะธ ะฟั€ะพะผะตะถัƒั‚ะพั‡ะฝั‹ั… ะฟั€ะพะดัƒะบั†ะธะธ ะธะท ะšะธั‚ะฐั ะพั‡ะตะฝัŒ ะฒั‹ัะพะบะฐ. ะš ั‚ะพะผัƒ ะถะต, ั ะผะพะผะตะฝั‚ะฐ ะฝะฐั‡ะฐะปะฐ ะฟะพะปะธั‚ะธะบะธ ะกะจะ, ะฝะฐะฟั€ะฐะฒะปะตะฝะฝะพะน ะฟั€ะพั‚ะธะฒ ะšะธั‚ะฐั (ั 2018 ะณะพะดะฐ), ะธะฝะฒะตัั‚ะธั†ะธะธ ะšะธั‚ะฐั ะฒ ะ’ัŒะตั‚ะฝะฐะผ ั€ะฐัั‚ัƒั‚.
  • Viแป‡t โ†’ French
Chรญnh quyแปn รดng Trump ฤ‘รฃ cแบฃnh bรกo cรกc nฦฐแป›c khรกc khรดng trแบฃ ฤ‘ลฉa sau khi cรดng bแป‘ chรญnh sรกch thuแบฟ quan mแป›i vร o tuแบงn trฦฐแป›c.
Nhiแปu quแป‘c gia, bao gแป“m Nhแบญt Bแบฃn, bร y tแป sแบตn sร ng ฤ‘ร m phรกn vแป thuแบฟ quan, nhฦฐng Trung Quแป‘c ฤ‘ang cรณ lแบญp trฦฐแปng cแปฉng rแบฏn hฦกn.
Cรกc ฤ‘แป™ng thรกi trแบฃ ฤ‘ลฉa thuแบฟ quan liรชn tแปฅc cรณ nguy cฦก khiแบฟn hoแบกt ฤ‘แป™ng thฦฐฦกng mแบกi giแปฏa 2 nแปn kinh tแบฟ quan trแปng nhแบฅt thแบฟ giแป›i bแป‹ ฤ‘รฌnh trแป‡, tแป CNBC nhแบญn ฤ‘แป‹nh.
Trฦฐแป›c ฤ‘แป™ng thรกi mแป›i nhแบฅt cแปงa Trung Quแป‘c, chแปฉng khoรกn tฦฐฦกng lai Mแปน giแบฃm mแบกnh.
Chแป‰ sแป‘ cรดng nghiแป‡p trung bรฌnh Dow Jones giแบฃm gแบงn 560 ฤ‘iแปƒm, tฦฐฦกng ฤ‘ฦฐฦกng 1,5%. S&P giแบฃm 1,3% cรฒn Nasdaq 100 giแบฃm 0,9%.

โ†’ L'administration Trump a averti d'autres pays de ne pas riposter aprรจs avoir annoncรฉ sa nouvelle politique tarifaire la semaine derniรจre.
De nombreux pays, dont le Japon, ont exprimรฉ leur volontรฉ de nรฉgocier sur les droits de douane, mais la Chine adopte une position plus ferme.
Les mesures retaliatoires tarifaires rรฉpรฉtรฉes risquent de freiner le commerce entre les deux economies les plus importantes du monde, selon CNBC.
Suite ร  la nouvelle action de la Chine, les contrats boursiers amรฉricains ont chutรฉ de maniรจre significative.
L'indice industrial moyen Dow Jones a baissรฉ de prรจs de 560 points, soit 1,5 %. Le S&P a chutรฉ de 1,3 % et le Nasdaq 100 de 0,9 %.
  • German โ†’ Viแป‡t:
Trumps so รผberraschende wie knappe Ankรผndigung in den sozialen Medien lieรŸ viele Fragen offen.
Seinen Schwenk begrรผndete der US-Prรคsident spรคter etwas wortreicher.
Er verwies dabei auf die wachsende Nervositรคt der anderen. So kann man die wachsende Angst vor einer Rezession und globaler Wirtschaftskrise natรผrlich auch umschreiben.
Die ยปLeuteยซ seien etwas unruhig und ยปein bisschen รคngstlichยซ geworden, sagte Trump lapidar bei einer Veranstaltung vor dem WeiรŸen Haus auf die Frage nach seinen Beweggrรผnden fรผr den jรผngsten Kurswechsel in der Handelspolitik.
ยปMan muss flexibel sein.ยซ

โ†’ Thรดng bรกo gรขy sแป‘c ฤ‘แป™t ngแป™t nร y trรชn mแบกng xรฃ hแป™i ฤ‘รฃ ฤ‘แปƒ lแบกi nhiแปu cรขu hแปi chฦฐa cรณ lแปi giแบฃi ฤ‘รกp. Tแป•ng thแป‘ng Mแปน sau ฤ‘รณ ฤ‘รฃ giแบฃi thรญch ฤ‘แป™ng cฦก cแปงa mรฌnh mแป™t cรกch dร i dรฒng hฦกn.
ร”ng ta chแป‰ ra sแปฑ lo lแบฏng ngร y cร ng tฤƒng cแปงa nhแปฏng ngฦฐแปi khรกc. ฤiแปu nร y tแบฅt nhiรชn cรณ thแปƒ diแป…n ฤ‘แบกt lแบกi nแป—i sแปฃ hรฃi ngร y cร ng tฤƒng vแป suy thoรกi kinh tแบฟ vร  khแปงng hoแบฃng kinh tแบฟ toร n cแบงu.
"Mแปi ngฦฐแปi" ฤ‘รฃ trแปŸ nรชn hฦกi bแป“n chแป“n vร  "hฦกi lo lแบฏng", Trump nรณi ngแบฏn gแปn tแบกi mแป™t sแปฑ kiแป‡n trฦฐแป›c Nhร  Trแบฏng khi trแบฃ lแปi cรขu hแปi vแป ฤ‘แป™ng cฦก ฤ‘แป•i hฦฐแป›ng gแบงn ฤ‘รขy trong chรญnh sรกch thฦฐฦกng mแบกi: "Phแบฃi linh hoแบกt".
  • Ancient Chinese (Cแป• vฤƒn) โ†’ Viแป‡t:
ใ€Š้•ท้ƒจ็ถ“ๅ…ธใ€‹๏ผšใ€Œๆ–ผไน…้ ไน‹ๅ‰๏ผŒๆ–ผๅไบ”ๆ—ฅๅธƒ่–ฉไน‹ๆปฟๆœˆๅคœ๏ผŒไธ‰ๅไธ‰ๅคฉไน‹่ซธๅคฉ๏ผŒ็š†้›†ๆœƒๆ–ผๅ–„ๆณ•ๅ ‚๏ผŒๅคฉไบบไน‹ๅคงๆœƒ็œพ๏ผŒๅพงๅๆ–ผ้€ฑ้ญ๏ผŒๅ››ๅคฉ็Ž‹ๅฐฑๅๆ–ผๅ››ๆ–น๏ผšๆฑๆ–นๆŒๅœ‹ๅคฉ็Ž‹ๆ–ผ่ซธๅคฉไน‹ๅ‰๏ผŒๅ‘่ฅฟ่€Œๅ๏ผ›ๅ—ๆ–นๅขž้•ทๅคฉ็Ž‹ๆ–ผ่ซธๅคฉไน‹ๅ‰๏ผŒๅ‘ๅŒ—่€Œๅ๏ผ›่ฅฟๆ–นๅปฃ็›ฎๅคฉ็Ž‹ๆ–ผ่ซธๅคฉไน‹ๅ‰๏ผŒๅ‘ๆฑ่€Œๅ๏ผ›ๅŒ—ๆ–นๅคš่žๅคฉ็Ž‹ๆ–ผ่ซธๅคฉไน‹ๅ‰๏ผŒๅ‘ๅ—่€Œๅใ€‚ไธ–ๅฐŠ๏ผไธ‰ๅไธ‰ๅคฉไน‹่ซธๅคฉ๏ผŒ็š†้›†ๆœƒๆ–ผๅ–„ๆณ•ๅ ‚๏ผŒๅคฉไบบไน‹ๅคงๆœƒ็œพ๏ผŒๅพงๅๆ–ผ้€ฑ้ญ๏ผŒๅ››ๅคงๅคฉ็Ž‹ๅๆ–ผๅ››ๆ–น๏ผŒๆญคๆ˜ฏๅฝผ็ญ‰ใ€”ๅ››ๅคฉ็Ž‹ใ€•ไน‹ๅๆณ•๏ผ›็„ถๅพŒไนƒๆˆ‘็ญ‰ไน‹ๅบงใ€‚ไธ–ๅฐŠ๏ผๆ›พๆ–ผไธ–ๅฐŠไน‹่™•ไฟฎๆขต่กŒ่€Œๆ–ฐ็”Ÿๆ–ผไธ‰ๅไธ‰ๅคฉไน‹ๅคฉ็œพ๏ผŒๅฎน่ฒŒ่ˆ‡ๅ…‰่ผ๏ผŒๆฏ”ๅ…ถไป–ๅคฉ็œพๆฎŠๅ‹ๅ…‰่€€๏ผŒไธ–ๅฐŠ๏ผๆ˜ฏๆ•…ไธ‰ๅไธ‰ๅคฉไน‹่ซธๅคฉ๏ผŒๆญกๅ–œใ€ๆ‚…ๆจ‚ใ€ๅ–œๆ‚…ใ€ๆปฟ่ถณ่จ€๏ผšใ€Žๅฏฆ็„ถ๏ผ่ซธๅคฉ็œพๅœจๅขž็››๏ผŒ้˜ฟไฟฎ็พ…็œพๅœจ่กฐๆธ›ใ€‚

โ†’  Trong kinh Trฦฐแปng Bแป™, chรบng tรดi nghe nhฦฐ vแบงy:
  - ThuแปŸ xฦฐa rแบฅt xa, vร o ngร y rแบฑm trฤƒng trรฒn, cรณ ฤ‘แบกi hแป™i chฦฐ Thiรชn cรตi trแปi Ba Mฦฐฦกi Ba hแปp tแบกi Thiแป‡n phรกp ฤ‘ฦฐแปng, ฤ‘แบกi chรบng cแปงa chฦฐ Thiรชn แปŸ xung quanh, Tแปฉ ฤแบกi Thiรชn Vฦฐฦกng ngแป“i แปŸ bแป‘n phฦฐฦกng: ฤแบฅng Trรฌ Quแป‘c Thiรชn Vฦฐฦกng แปŸ phรญa trฦฐแป›c chฦฐ Thiรชn hฦฐแป›ng vแป Tรขy; ฤแบฅng Tฤƒng TrฦฐแปŸng Thiรชn Vฦฐฦกng แปŸ trฦฐแป›c chฦฐ Thiรชn hฦฐแป›ng vแป Bแบฏc; ฤแบฅng Quแบฃng Mแปฅc Thiรชn Vฦฐฦกng แปŸ trฦฐแป›c chฦฐ Thiรชn hฦฐแป›ng vแป ฤรดng; ฤแบฅng ฤa Vฤƒn Thiรชn Vฦฐฦกng แปŸ trฦฐแป›c chฦฐ Thiรชn hฦฐแป›ng vแป Nam.
    Nร y Thแบฟ Tรดn! Chฦฐ Thiรชn แปŸ Ba Mฦฐฦกi Ba tแบญp hแปฃp tแบกi Thiแป‡n phรกp ฤ‘ฦฐแปng, ฤ‘แบกi chรบng cแปงa chฦฐ Thiรชn แปŸ xung quanh, Tแปฉ ฤแบกi Thiรชn Vฦฐฦกng ngแป“i แปŸ bแป‘n phฦฐฦกng, ฤ‘รขy lร  cรกch an tแปa cแปงa cรกc Ngร i, sau ฤ‘รณ mแป›i ฤ‘แบฟn lฦฐแปฃt chรบng con.
    Nร y Thแบฟ Tรดn! Chรบng con tแปซng tu hร nh khแป• hแบกnh แปŸ chแป— Thแบฟ Tรดn, sau khi tรกi sinh vร o hร ng chฦฐ Thiรชn แปŸ cรตi trแปi Ba Mฦฐฦกi Ba, nhan sแบฏc vร  รกnh sรกng hฦกn hแบณn chฦฐ Thiรชn khรกc.
    Nร y Thแบฟ Tรดn! Vรฌ thแบฟ, chฦฐ Thiรชn แปŸ Ba Mฦฐฦกi Ba vui mแปซng, hoan hแปท, thแปa mรฃn vร  nรณi: "Thแบญt vแบญy, sแป‘ lฦฐแปฃng chฦฐ Thiรชn tฤƒng lรชn, sแป‘ lฦฐแปฃng chรบng A Tu La giแบฃm bแป›t.

# Install Transformers from main branch to support Gemma3
# pip install git+https://github.com/huggingface/transformers
# MAX_JOBS=4 pip install flash-attn --no-build-isolation

import os, torch
os.environ["CUDA_VISIBLE_DEVICES"] = "0"

from transformers import AutoTokenizer, AutoProcessor, Gemma3ForConditionalGeneration, AutoModel
import torch

model_path = "erax-ai/EraX-Translator-V1.0"

model =  Gemma3ForConditionalGeneration.from_pretrained(model_path,
                                        torch_dtype=torch.bfloat16,
                                        attn_implementation="flash_attention_2").to("cuda")
tokenizer =  AutoTokenizer.from_pretrained(model_path)
processor =  AutoProcessor.from_pretrained(model_path)

system_prompt = """Bแบกn lร  Trแปฃ lรฝ AI xuแบฅt sแบฏc vแป dแป‹ch thuแบญt nhiแปu ngรดn ngแปฏ, ฤ‘แบทc biแป‡t tiแบฟng Anh, tiแบฟng Trung Hoa, tiแบฟng Viแป‡t. 
Bแบกn cลฉng lร  1 Hoร  thฦฐแปฃng Phแบญt giรกo uyรชn thรขm vแป dแป‹ch thuแบญt Cแป• vฤƒn Trung Quแป‘c. Ngฦฐแปi dรนng sแบฝ giao nhiแป‡m vแปฅ dแป‹ch thuแบญt cho bแบกn tแปซ ngรดn ngแปฏ bแบฅt kแปณ sang mแป™t ngรดn ngแปฏ ฤ‘ฦฐแปฃc chแป‰ ฤ‘แป‹nh.
Nhiแป‡m vแปฅ cแปงa bแบกn lร  dแป‹ch thแบญt sรกt nghฤฉa, thแปƒ hiแป‡n ฤ‘รบng รฝ cแปงa bร i gแป‘c vร  khรดng chแบฟ tรกc hay bแป‹a ฤ‘แบทt gรฌ thรชm. ฤแบทc biแป‡t lฦฐu รฝ danh xฦฐng phแบฃi giแปฏ nguyรชn vแบนn, dแป‹ch ฤ‘รบng tรชn ngฦฐแปi, tรชn ฤ‘แป‹a danh phแบฃi tuyแป‡t ฤ‘แป‘i chรญnh xรกc. Khรดng ฤ‘ฦฐแปฃc bรฌnh luแบญn, khรดng ฤ‘ฦฐแปฃc cung cแบฅp lแปi giแป›i thiแป‡u hay mแปŸ bร i hay kแบฟt luแบญn gรฌ, chแป‰ dแป‹ch thแบญt sรกt nghฤฉa vร  khรดng bแป qua bแบฅt kแปณ รฝ hay tแปซ nร o.
"""

system_tag = {
    "role": "system",
    "content": system_prompt
}

to_lang = "Viแป‡t"
instruct = f"\nDแป‹ch sang tiแบฟng {to_lang}."

to_translate = "ไธ‰ๅฏถ่€…๏ผŒๅพ่ผฉๅกตไธ–ไน‹่‡ณๅฐŠไนŸใ€‚ๅคซๆฌฒๅ‡บๅฎถ่€…๏ผŒๅง‹ไบฆ็šˆไพไธ‰ๅฏถ๏ผŒ็นผๅ—ไบ”ๆˆ’๏ผŒไนƒ่‡ณๅ…ซ้—œ้ฝ‹ๆˆ’๏ผŒๅ…ถๅพŒๆ–นๆˆๆฒ™ๅฝŒใ€‚ๆญค่ช ไฝ›้“ๅธธ่ปŒ๏ผŒๅ‡กๅฅ‰ไฝ›ๅœ‹๏ผŒๅ’ธๆ‰€้ต่กŒใ€‚ๅพๆณ•่ฏ้“ๅ ดไบฆ็„ถใ€‚ๆ•…็™ผๅฎ้ก˜๏ผš้ก˜ไธ–ไธ–็”Ÿ็”Ÿ๏ผŒๅ€ผ้‡ไธ‰ๅฏถ๏ผŒๆญๆ•ฌไพ›้คŠ๏ผŒไพไฝ›่–ๆ•™๏ผŒๅฅ‰่กŒ็œพๅ–„ใ€‚ๆญคๅณๅพ็ญ‰ๆ‰€ๅšฎไน‹้ต ็š„ไนŸใ€‚"

prompt_in = [
    system_tag,
    {
        "role": "user",
        "content": to_translate + instruct
    }
]


input_ids = tokenizer.apply_chat_template(prompt_in, tokenize=False, add_generation_prompt=True)
input_ids = tokenizer(input_ids, return_tensors="pt").to("cuda")

import time
from transformers import TextIteratorStreamer
from threading import Thread

streamer = TextIteratorStreamer(
        tokenizer,
        skip_prompt=True,
        timeout=5.0,
)

generation_args = {
        "max_length": 8192,
        "streamer": streamer,
        "temperature": 0.2, 
        "top_k": 64, 
        "top_p": 0.95,
        "min_p": 0.0,
        "repetition_penalty": 1.05,
        "do_sample": True,
    }
generation_args.update(input_ids)

thread = Thread(
        target=model.generate,
        kwargs=generation_args,
    )
thread.start()

acc_text = ""
for text_token in streamer:
    #time.sleep(0.04)
    if text_token != tokenizer.eos_token:
        print (text_token, end="", flush=True)
        acc_text += text_token
thread.join()

>>> Tam Bแบฃo lร  ngรดi bรกu cao quรฝ nhแบฅt แปŸ nฦกi chรบng ta sinh sแป‘ng. ฤแป‘i vแป›i nhแปฏng ngฦฐแปi xuแบฅt gia thรฌ ฤ‘แบงu tiรชn hแป xin quy y Tam Bแบฃo, tiแบฟp ฤ‘รณ lร  thแป ngลฉ giแป›i rแป“i Bรกt Quan Trai giแป›i, sau ฤ‘รณ hแป mแป›i trแปŸ thร nh Sa Di. ฤรขy mแป›i chรญnh lร  cรกch thแปฉc mร  ฤ‘แบกo Phแบญt vแบซn thฦฐแปng lร m, bแบฅt kแปณ quแป‘c gia nร o theo ฤ‘แบกo Phแบญt ฤ‘แปu lร m nhฦฐ vแบญy. ฤแบกo trร ng Phรกp Hoa cแปงa tรกc giแบฃ cลฉng lร  mแป™t vรญ dแปฅ ฤ‘iแปƒn hรฌnh. Vรฌ thแบฟ tรกc giแบฃ ฤ‘รฃ cรณ lแปi nguyแป‡n rแบฑng: Nguyแป‡n ฤ‘แปi ฤ‘แปi kiแบฟp kiแบฟp gแบทp ฤ‘ฦฐแปฃc Tam Bแบฃo, tรดn kรญnh cรบng dฦฐแปng vร  lร m theo lแปi dแบกy cแปงa ฤ‘แปฉc Phแบญt cรนng cรกc thรกnh tฤƒng, phแปฅng hร nh mแปi ฤ‘iแปu thiแป‡n. ฤรขy chรญnh lร  mแปฅc tiรชu hฦฐแป›ng ฤ‘แบฟn cแปงa chรบng ta.

NOTA BENE on instruction for Chinese language:

Providing this precise instruction, such as "Dแป‹ch sang tiแบฟng [specified dialect]", will significantly improve the quality and appropriateness of the translation output. For example, in Vietnamese, "Dแป‹ch sang tiแบฟng [Chinese dialect]" will provide better context for accurate translations. Try them out, such as:

  • "Dแป‹ch sang tiแบฟng Hoa"
  • "Dแป‹ch sang tiแบฟng Chinese"
  • "Dแป‹ch sang tiแบฟng Quแบฃng ฤรดng"
  • "Dแป‹ch sang tiแบฟng Cantonese"
  • "Dแป‹ch sang tiแบฟng Cแป• Vฤƒn Trung Hoa"

You can also use vLLM docker to run to get fatest speed (80 tokens/second) and use Ollama to connect to http://localhost:8000/v1

docker run --rm -it --entrypoint "/usr/bin/bash" --network=host --gpus '"device=0"' -v ./:/models --shm-size=32gb  -p 8000:8000 \
  vllm/vllm-openai:latest \
  -c "pip install git+https://github.com/huggingface/[email protected] && \
      python3 -m vllm.entrypoints.openai.api_server" --max_model_len 4096 --model erax-ai/EraX-Translator-V1.0"

Ethical Considerations

We recognize the potential for misuse of machine translation technology and encourage users to use this model responsibly and ethically. We are committed to addressing potential biases in the model and improving its fairness and accuracy.

Acknowledgements

We would like to express our sincere gratitude to:

  • The developers of the Gemma3 family of models.
  • The open-source community for their contributions to the development of machine translation technology.
  • The Trแบงn Nhรขn Tรดng Institute, Vietnam National University, Hanoi, for their invaluable contribution of translated Buddhist texts.

Future Directions

We are actively working to improve the model in the following areas:

  • Expanding the language coverage.
  • Improving the accuracy and fluency of translations.
  • Developing more robust evaluation metrics.
  • Optimizing the model for even greater efficiency.
  • Exploring techniques for mitigating bias.
  • Better supporting llama.cpp.

We welcome feedback from the community and look forward to working together to advance the field of multilingual translation.

License:

We are bound with Google Gemma license. You are mostly free to use.

Citation ๐Ÿ“

If you find our project useful, we would appreciate it if you could star our repository and cite our work as follows:

@article{title={EraX-Translatoe-V1.0: A Compact and Capable Multilingual Translation Model},
  author={Nguyแป…n Anh Nguyรชn, Hatto & EraX Team},
  organization={Hatto & EraX},
  year={2025},
  url={https://huggingface.co/erax-ai/EraX-Translator-V1.0}
}
Downloads last month
403
Safetensors
Model size
4.3B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ 1 Ask for provider support

Model tree for erax-ai/EraX-Translator-V1.0

Finetuned
(79)
this model
Quantizations
2 models