M2M100 Model 1.2B for Lopatnov.Translate

This repository contains an ONNX-converted version of the M2M100 1.2B model, optimized for the Lopatnov.Translate service. These files are converted from the original weights in the facebook/m2m100_1.2B 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_1.2B --task seq2seq-lm --dtype fp32 --opset 18 ./m2m100_1.2B 

Configuration

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

Example configuration:

{
  "Models": {
    "m2m100_1.2B": {
      "Type": "M2M100",
      "Path": "../../models/translate/m2m100_1.2B",
      "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_1.2B" ], // Whitelist allowed models if needed
    "DefaultModel": "m2m100_1.2B", // Set this model as the default
    "WarmUp": [ "m2m100_1.2B" ] // 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
6
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for lopatnov/m2m100_1.2B-onnx

Quantized
(4)
this model