M2M100-418M for MindSpore Lite

facebook/m2m100_418M, converted for MindSpore Lite, the inference engine built into HarmonyOS. It is the on-device translation model of zen-Babel for HarmonyOS, which downloads these files when it is built and bundles them in the app.

File What it is
encoder.ms Encoder. Inputs input_ids [1,128] int32 and attention_mask [1,128] int32 (padding at the end); output cross_kv [24,1,16,128,64], the cross-attention keys and values of all 12 decoder layers
decoder.ms One greedy decoding step. Inputs token [1,1], step [1], self_kv [24,1,16,256,64] (a 256-slot self-attention cache), self_mask [1,1,1,257], cross_kv, cross_mask [1,1,1,128]; outputs next_token [1] and new_kv [24,1,16,1,64]
sentencepiece.bpe.model The original SentencePiece model
vocab.txt Token table: line N is the piece with id N, language tokens (__en__, __ja__, ...) included
SHA256SUMS Checksums of the four files

Weights are int8 (MindSpore Lite weight quantization); masks use -1e4, so the graphs run with FP16 CPU kernels. All shapes are fixed, because MindSpore Lite's FP16 runtime does not handle resizing. Greedy output equals Hugging Face's generate(num_beams=1) before quantization.

The files are made by tools/m2m100/convert.sh (ONNX export, converter_lite from MindSpore Lite 2.7.0, then a check of the app's own engine code against the result). The engine that runs them is entry/src/main/cpp/m2m100_engine.cpp.

License

MIT, as the original model. M2M100 is by Meta AI (Fan et al., Beyond English-Centric Multilingual Machine Translation, 2020). Copyright (c) Facebook, Inc. and its affiliates.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for etspworks/m2m100-418m-mindspore-lite

Finetuned
(196)
this model