Instructions to use SevenAIGmbH/opus-mt-de-pl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use SevenAIGmbH/opus-mt-de-pl with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('translation', 'SevenAIGmbH/opus-mt-de-pl');
https://huggingface.co/Helsinki-NLP/opus-mt-de-pl with ONNX weights to be compatible with Transformers.js.
Same layout as the Xenova/opus-mt-* repos: fp32 graphs plus fp16, quantized (q8), int8, uint8,
q4, q4f16 and bnb4 variants under onnx/. Converted with the transformers.js 3.7.0 conversion scripts
(optimum + onnxruntime 1.20.1), with these fixes:
decoder_model_mergedis re-merged without onnxslim (the slimmed graph fails in onnxruntime's extended graph optimizations for the past-key-values branch) and saved as ONNX IR 8, so it loads in onnxruntime-web 1.14 (@xenova/transformersv2).- The tied
lm_headweight Transpose is placed after the embedding Gather, so 8-bit quantization does not keep an extra fp32 copy of the embedding matrix.
Usage (Transformers.js)
import { pipeline } from '@huggingface/transformers';
const translator = await pipeline('translation', 'SevenAIGmbH/opus-mt-de-pl');
const output = await translator('Hallo, wie geht es dir?');
Attribution
The model weights are by the Language Technology Research Group at the University of Helsinki (OPUS-MT), released under the Apache License 2.0 as declared in the source repository. Only the format was changed (converted to ONNX and quantized).
- Downloads last month
- -
Model tree for SevenAIGmbH/opus-mt-de-pl
Base model
Helsinki-NLP/opus-mt-de-pl