Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: cc-by-4.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
tags:
|
| 4 |
+
- translation
|
| 5 |
+
- onnx
|
| 6 |
+
- marian
|
| 7 |
+
- android
|
| 8 |
+
language:
|
| 9 |
+
- de
|
| 10 |
+
- ar
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# opus-mt-de-ar (ONNX)
|
| 14 |
+
|
| 15 |
+
ONNX export of [Helsinki-NLP/opus-mt-de-ar](https://huggingface.co/Helsinki-NLP/opus-mt-de-ar) for on-device inference on Android.
|
| 16 |
+
|
| 17 |
+
## Files
|
| 18 |
+
|
| 19 |
+
| File | Description |
|
| 20 |
+
|---|---|
|
| 21 |
+
| `encoder_model.onnx` | Encodes the input sentence |
|
| 22 |
+
| `decoder_model.onnx` | Generates the translated tokens |
|
| 23 |
+
| `source.spm` | Source language (German) tokenizer |
|
| 24 |
+
| `target.spm` | Target language (Arabic) tokenizer |
|
| 25 |
+
|
| 26 |
+
## Usage in Android
|
| 27 |
+
|
| 28 |
+
Download the files and run inference with [ONNX Runtime for Android](https://onnxruntime.ai/).
|
| 29 |
+
|
| 30 |
+
```
|
| 31 |
+
Encoder input: input_ids, attention_mask
|
| 32 |
+
Encoder output: encoder_hidden_states
|
| 33 |
+
|
| 34 |
+
Decoder input: decoder_input_ids, encoder_hidden_states, encoder_attention_mask
|
| 35 |
+
Decoder output: logits
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
Run the encoder once per sentence, then loop the decoder to generate tokens until the EOS token is produced.
|
| 39 |
+
|
| 40 |
+
## Credits
|
| 41 |
+
|
| 42 |
+
Original model by [Helsinki-NLP](https://huggingface.co/Helsinki-NLP), trained on [OPUS](https://opus.nlpl.eu/) data.
|
| 43 |
+
ONNX conversion by [YOUR_NAME].
|
| 44 |
+
|
| 45 |
+
## License
|
| 46 |
+
|
| 47 |
+
[CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) — same as the original model.
|