Instructions to use TigreGotico/opus-mt-az-en-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TigreGotico/opus-mt-az-en-onnx with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="TigreGotico/opus-mt-az-en-onnx")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("TigreGotico/opus-mt-az-en-onnx") model = AutoModelForSeq2SeqLM.from_pretrained("TigreGotico/opus-mt-az-en-onnx", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -47,15 +47,36 @@ print(tok.decode(out[0], skip_special_tokens=True))
|
|
| 47 |
|
| 48 |
## Parity with the original PyTorch model
|
| 49 |
|
| 50 |
-
10 general-domain Azerbaijani sentences
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
| Decoding | fp32 exact match | int8 exact match |
|
| 54 |
|---|---|---|
|
| 55 |
-
| greedy (num_beams=1) | 10/10 (100.0%) |
|
| 56 |
-
| beam=4 | 10/10 (100.0%) |
|
| 57 |
|
| 58 |
fp32 is a faithful reproduction of the original model at both decoding
|
| 59 |
-
settings. int8
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
## Parity with the original PyTorch model
|
| 49 |
|
| 50 |
+
10 general-domain **Azerbaijani** sentences (source language for this az->en
|
| 51 |
+
pair), exact-string-match of generated output against `MarianMTModel.generate()`
|
| 52 |
+
on the original `Helsinki-NLP/opus-mt-az-en` checkpoint.
|
| 53 |
+
|
| 54 |
+
```yaml
|
| 55 |
+
parity:
|
| 56 |
+
fp32_greedy: 1.00 # 10/10
|
| 57 |
+
fp32_beam4: 1.00 # 10/10
|
| 58 |
+
int8_greedy: 0.70 # 7/10
|
| 59 |
+
int8_beam4: 0.90 # 9/10
|
| 60 |
+
```
|
| 61 |
|
| 62 |
| Decoding | fp32 exact match | int8 exact match |
|
| 63 |
|---|---|---|
|
| 64 |
+
| greedy (num_beams=1) | 10/10 (100.0%) | 7/10 (70.0%) |
|
| 65 |
+
| beam=4 | 10/10 (100.0%) | 9/10 (90.0%) |
|
| 66 |
|
| 67 |
fp32 is a faithful reproduction of the original model at both decoding
|
| 68 |
+
settings. int8 disagreements were inspected by hand, not just counted: they
|
| 69 |
+
are genuinely **different, not worse** - e.g. beam=4 on "Bu axşam iki
|
| 70 |
+
nəfərlik masa sifariş etmək istəyirəm." gives ref "...pay two men a
|
| 71 |
+
denarii." vs int8 "...pay two men a denunciation." (a near-miss on one rare
|
| 72 |
+
word), and greedy on "Bu, maşın tərcüməsi üçün test cümləsidir." gives ref
|
| 73 |
+
"...test for the drive." vs int8 "...test for the translation work." (int8
|
| 74 |
+
is arguably closer to the correct meaning there). No degenerate or garbled
|
| 75 |
+
output was observed in any int8 sample.
|
| 76 |
+
|
| 77 |
+
An earlier version of this card reported int8 40%/40% from a harness bug -
|
| 78 |
+
the parity script had reused a fixed **English** sentence set across all
|
| 79 |
+
opus-mt pairs, but this model's source language is Azerbaijani, not
|
| 80 |
+
English, so that measurement compared the model against out-of-distribution
|
| 81 |
+
input and was discarded. The numbers above are the corrected, re-measured
|
| 82 |
+
values using real Azerbaijani source sentences.
|