Translation
ExecuTorch
opus-mt-ExecuTorch / README.md
msluszniak's picture
Add opus-mt exports
95385ea verified
|
Raw History Blame
8.68 kB
metadata
license: other
license_name: apache-2.0-and-cc-by-4.0
license_link: LICENSE
pipeline_tag: translation
library_name: executorch
language:
  - en
  - de
  - es
  - fr
base_model:
  - Helsinki-NLP/opus-mt-en-de
  - Helsinki-NLP/opus-mt-de-en
  - Helsinki-NLP/opus-mt-en-es
  - Helsinki-NLP/opus-mt-es-en
  - Helsinki-NLP/opus-mt-en-fr
  - Helsinki-NLP/opus-mt-fr-en

opus-mt

This repository hosts the opus-mt models exported for the React Native ExecuTorch library as ExecuTorch .pte programs, ready to run on device.

Variants

Path Backend Precision
en_de/xnnpack/opus_mt_en_de_xnnpack_fp32.pte xnnpack fp32
en_de/xnnpack/opus_mt_en_de_xnnpack_int8.pte xnnpack int8
en_de/coreml/opus_mt_en_de_coreml_fp16.pte coreml fp16
en_de/mlx/opus_mt_en_de_mlx_bf16.pte mlx bf16
en_de/mlx/opus_mt_en_de_mlx_int8.pte mlx int8
en_de/vulkan/opus_mt_en_de_vulkan_fp16.pte vulkan fp16
de_en/xnnpack/opus_mt_de_en_xnnpack_fp32.pte xnnpack fp32
de_en/xnnpack/opus_mt_de_en_xnnpack_int8.pte xnnpack int8
de_en/coreml/opus_mt_de_en_coreml_fp16.pte coreml fp16
de_en/mlx/opus_mt_de_en_mlx_bf16.pte mlx bf16
de_en/mlx/opus_mt_de_en_mlx_int8.pte mlx int8
de_en/vulkan/opus_mt_de_en_vulkan_fp16.pte vulkan fp16
en_es/xnnpack/opus_mt_en_es_xnnpack_fp32.pte xnnpack fp32
en_es/xnnpack/opus_mt_en_es_xnnpack_int8.pte xnnpack int8
en_es/coreml/opus_mt_en_es_coreml_fp16.pte coreml fp16
en_es/mlx/opus_mt_en_es_mlx_bf16.pte mlx bf16
en_es/mlx/opus_mt_en_es_mlx_int8.pte mlx int8
en_es/vulkan/opus_mt_en_es_vulkan_fp16.pte vulkan fp16
es_en/xnnpack/opus_mt_es_en_xnnpack_fp32.pte xnnpack fp32
es_en/xnnpack/opus_mt_es_en_xnnpack_int8.pte xnnpack int8
es_en/coreml/opus_mt_es_en_coreml_fp16.pte coreml fp16
es_en/mlx/opus_mt_es_en_mlx_bf16.pte mlx bf16
es_en/mlx/opus_mt_es_en_mlx_int8.pte mlx int8
es_en/vulkan/opus_mt_es_en_vulkan_fp16.pte vulkan fp16
en_fr/xnnpack/opus_mt_en_fr_xnnpack_fp32.pte xnnpack fp32
en_fr/xnnpack/opus_mt_en_fr_xnnpack_int8.pte xnnpack int8
en_fr/coreml/opus_mt_en_fr_coreml_fp16.pte coreml fp16
en_fr/mlx/opus_mt_en_fr_mlx_bf16.pte mlx bf16
en_fr/mlx/opus_mt_en_fr_mlx_int8.pte mlx int8
en_fr/vulkan/opus_mt_en_fr_vulkan_fp16.pte vulkan fp16
fr_en/xnnpack/opus_mt_fr_en_xnnpack_fp32.pte xnnpack fp32
fr_en/xnnpack/opus_mt_fr_en_xnnpack_int8.pte xnnpack int8
fr_en/coreml/opus_mt_fr_en_coreml_fp16.pte coreml fp16
fr_en/mlx/opus_mt_fr_en_mlx_bf16.pte mlx bf16
fr_en/mlx/opus_mt_fr_en_mlx_int8.pte mlx int8
fr_en/vulkan/opus_mt_fr_en_vulkan_fp16.pte vulkan fp16

Repository structure

LICENSE                                        360 B
config.json                                    29 B
de_en/coreml/config.json                       5.5 kB
de_en/coreml/opus_mt_de_en_coreml_fp16.pte     313.6 MB
de_en/mlx/config.json                          10.6 kB
de_en/mlx/opus_mt_de_en_mlx_bf16.pte           148.9 MB
de_en/mlx/opus_mt_de_en_mlx_int8.pte           135.8 MB
de_en/tokenizer.json                           2.4 MB
de_en/vulkan/config.json                       5.5 kB
de_en/vulkan/opus_mt_de_en_vulkan_fp16.pte     129.3 MB
de_en/xnnpack/config.json                      10.6 kB
de_en/xnnpack/opus_mt_de_en_xnnpack_fp32.pte   416.8 MB
de_en/xnnpack/opus_mt_de_en_xnnpack_int8.pte   107.0 MB
en_de/coreml/config.json                       5.4 kB
en_de/coreml/opus_mt_en_de_coreml_fp16.pte     313.6 MB
en_de/mlx/config.json                          10.6 kB
en_de/mlx/opus_mt_en_de_mlx_bf16.pte           148.9 MB
en_de/mlx/opus_mt_en_de_mlx_int8.pte           135.8 MB
en_de/tokenizer.json                           2.4 MB
en_de/vulkan/config.json                       5.4 kB
en_de/vulkan/opus_mt_en_de_vulkan_fp16.pte     129.3 MB
en_de/xnnpack/config.json                      10.6 kB
en_de/xnnpack/opus_mt_en_de_xnnpack_fp32.pte   416.8 MB
en_de/xnnpack/opus_mt_en_de_xnnpack_int8.pte   107.0 MB
en_es/coreml/config.json                       5.5 kB
en_es/coreml/opus_mt_en_es_coreml_fp16.pte     334.8 MB
en_es/mlx/config.json                          10.6 kB
en_es/mlx/opus_mt_en_es_mlx_bf16.pte           156.0 MB
en_es/mlx/opus_mt_en_es_mlx_int8.pte           146.5 MB
en_es/tokenizer.json                           2.7 MB
en_es/vulkan/config.json                       5.5 kB
en_es/vulkan/opus_mt_en_es_vulkan_fp16.pte     136.4 MB
en_es/xnnpack/config.json                      10.6 kB
en_es/xnnpack/opus_mt_en_es_xnnpack_fp32.pte   445.1 MB
en_es/xnnpack/opus_mt_en_es_xnnpack_int8.pte   114.1 MB
en_fr/coreml/config.json                       5.5 kB
en_fr/coreml/opus_mt_en_fr_coreml_fp16.pte     318.0 MB
en_fr/mlx/config.json                          10.6 kB
en_fr/mlx/opus_mt_en_fr_mlx_bf16.pte           150.4 MB
en_fr/mlx/opus_mt_en_fr_mlx_int8.pte           138.0 MB
en_fr/tokenizer.json                           2.4 MB
en_fr/vulkan/config.json                       5.5 kB
en_fr/vulkan/opus_mt_en_fr_vulkan_fp16.pte     130.7 MB
en_fr/xnnpack/config.json                      10.6 kB
en_fr/xnnpack/opus_mt_en_fr_xnnpack_fp32.pte   422.6 MB
en_fr/xnnpack/opus_mt_en_fr_xnnpack_int8.pte   108.4 MB
es_en/coreml/config.json                       5.5 kB
es_en/coreml/opus_mt_es_en_coreml_fp16.pte     334.8 MB
es_en/mlx/config.json                          10.6 kB
es_en/mlx/opus_mt_es_en_mlx_bf16.pte           156.0 MB
es_en/mlx/opus_mt_es_en_mlx_int8.pte           146.5 MB
es_en/tokenizer.json                           2.7 MB
es_en/vulkan/config.json                       5.5 kB
es_en/vulkan/opus_mt_es_en_vulkan_fp16.pte     136.4 MB
es_en/xnnpack/config.json                      10.6 kB
es_en/xnnpack/opus_mt_es_en_xnnpack_fp32.pte   445.1 MB
es_en/xnnpack/opus_mt_es_en_xnnpack_int8.pte   114.1 MB
fr_en/coreml/config.json                       5.5 kB
fr_en/coreml/opus_mt_fr_en_coreml_fp16.pte     318.0 MB
fr_en/mlx/config.json                          10.6 kB
fr_en/mlx/opus_mt_fr_en_mlx_bf16.pte           150.4 MB
fr_en/mlx/opus_mt_fr_en_mlx_int8.pte           138.0 MB
fr_en/tokenizer.json                           2.4 MB
fr_en/vulkan/config.json                       5.5 kB
fr_en/vulkan/opus_mt_fr_en_vulkan_fp16.pte     130.7 MB
fr_en/xnnpack/config.json                      10.6 kB
fr_en/xnnpack/opus_mt_fr_en_xnnpack_fp32.pte   422.6 MB
fr_en/xnnpack/opus_mt_fr_en_xnnpack_int8.pte   108.4 MB

Compatibility

These files are published for the ExecuTorch v1.4.1 runtime. ExecuTorch gives no forward compatibility guarantee, so an older runtime may fail to load them.

To use them in React Native ExecuTorch, pass the model constant shipped in the library's model registry to the corresponding task pipeline. See the documentation.

To load these files in your own ExecuTorch runtime, read the compatibility note first.

Upstream models and licenses

Each directory is one language pair with its own upstream model and license. en_de is CC-BY 4.0 and requires attribution to Helsinki-NLP Opus-MT.

Directory Upstream License
en_de Helsinki-NLP/opus-mt-en-de cc-by-4.0
de_en Helsinki-NLP/opus-mt-de-en apache-2.0
en_es Helsinki-NLP/opus-mt-en-es apache-2.0
es_en Helsinki-NLP/opus-mt-es-en apache-2.0
en_fr Helsinki-NLP/opus-mt-en-fr apache-2.0
fr_en Helsinki-NLP/opus-mt-fr-en apache-2.0

Export notes

Each .pte has two methods: encode returns the cross-attention keys and values of all decoder layers, and decode runs one greedy step against a 256-token self-attention cache held in the program. The tokenizer adds no </s>; append it, start decoding from <pad> and stop at </s>. Core ML encodes in fp16 on all compute units and decodes in fp32 on the CPU, because Core ML's fp16 state corrupts the cache. The Vulkan variant runs the encoder on the GPU and the decoder on XNNPACK int8.