Translation
Transformers.js
ONNX
English
Moroccan Arabic
marian
text2text-generation
darija
moroccan-arabic
Instructions to use essprod/darija-mt-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use essprod/darija-mt-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('translation', 'essprod/darija-mt-onnx');
Lost in Darija: English β Moroccan Darija (ONNX, 8-bit)
The Lost in Darija translation model (MarianMT Helsinki-NLP/opus-mt-en-ar fine-tuned on DODa,
fine_tuned_marian_v2) converted for Transformers.js:
encoder + merged decoder, 8-bit weights (143 MB). Used by essprod : Learn Darija Today
(Dictionary βΊ Translate), where it runs on the learner's device.
- Prefix every sentence with
>>ary<<(the model was trained that way). - Greedy decoding (Transformers.js has no beam search yet). Without compression the ONNX export gives exactly the original model's greedy output; 8-bit changes a word here and there.
- The fine-tuned model keeps separate encoder, decoder and output embeddings; the export keeps
that wiring (
_tmp/mt229/untie.py).tokenizer.jsonuses<unk>= 1, as the original.
import { pipeline } from "@huggingface/transformers";
const tr = await pipeline("translation", "essprod/darija-mt-onnx", { dtype: "q8" });
const [out] = await tr(">>ary<< Where is the train station?");
// ΩΩΩ Ψ¬Ψ§Ψͺ Ψ§ΩΩ
ΨΨ·Ψ©Ψ
Data: DODa, Darija Open Dataset (Outchakoucht & Es-Samaali, 2024).
- Downloads last month
- 32
Model tree for essprod/darija-mt-onnx
Base model
Helsinki-NLP/opus-mt-en-ar