M2M100 Model 418M for Lopatnov.Translate

This repository contains an ONNX-converted version of the M2M100 418M model, optimized for the Lopatnov.Translate service. These files are converted from the original weights in the facebook/m2m100_418M repository.

Conversion recipe

conda create -n model_export python=3.10 -y
conda activate model_export
pip install "optimum[onnxruntime,export,openvino]" transformers sentencepiece
optimum-cli export onnx --model facebook/m2m100_418M --task seq2seq-lm --dtype fp32 --opset 18 ./m2m100_418M

Configuration

To configure model for the service, please modify appsettings.json:

Example configuration:

{
  "Models": {
    "m2m100_418M": {
      "Type": "M2M100",
      "Path": "../../models/translate/m2m100_418M",
      "EncoderFile": "encoder_model.onnx",
      "DecoderFile": "decoder_model.onnx",
      "TokenizerFile": "sentencepiece.bpe.model",
      "TokenizerConfigFile": "added_tokens.json",
      "MaxTokens": 512,
      "VocabFile": "vocab.json"
    }
  },
  // These configurations are optional
  "Translation": {
    "AllowedModels": [ "m2m100_418M" ], // Whitelist allowed models if needed
    "DefaultModel": "m2m100_418M", // Set this model as the default
    "WarmUp": [ "m2m100_418M" ] // Load the model into memory on startup
  }
}

Note: Make sure the Path correctly points to the location of your downloaded .onnx files relative to application.

Documentation

For advanced configuration options, visit the Official Documentation.

Downloads last month
21
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for lopatnov/m2m100_418M-onnx

Quantized
(4)
this model