Views
No views yet
1conda create -n model_export python=3.10 -y
2conda activate model_export
3pip install "optimum[onnxruntime,export,openvino]" transformers sentencepiece
4optimum-cli export onnx --model facebook/nllb-200-1.3B --task seq2seq-lm --dtype fp32 --opset 18 ./model/nllb-200-1.3B-onnxappsettings.json:1{
2 "Models": {
3 "nllb-200-1.3B": {
4 "Type": "NLLB",
5 "Path": "../../models/translate/nllb-200-1.3B",
6 "EncoderFile": "encoder_model.onnx",
7 "DecoderFile": "decoder_model.onnx",
8 "TokenizerFile": "sentencepiece.bpe.model",
9 "TokenizerConfigFile": "tokenizer.json",
10 "MaxTokens": 512,
11 "BeamSize": 1
12 }
13 },
14 // These configurations are optional
15 "Translation": {
16 "AllowedModels": [ "nllb-200-1.3B" ], // Whitelist allowed models if needed
17 "DefaultModel": "nllb-200-1.3B", // Set this model as the default
18 "WarmUp": [ "nllb-200-1.3B" ] // Load the model into memory on startup
19 }
20}Path correctly points to the location of your downloaded .onnx files relative to application.