Jingya HF staff commited on
Commit
2d3dd17
1 Parent(s): 04e0aa0

update the readme

Browse files
Files changed (1) hide show
  1. README.md +13 -0
README.md CHANGED
@@ -3,6 +3,8 @@ license: mit
3
  ---
4
  # M2M100 418M
5
 
 
 
6
  M2M100 is a multilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many multilingual translation.
7
  It was introduced in this [paper](https://arxiv.org/abs/2010.11125) and first released in [this](https://github.com/pytorch/fairseq/tree/master/examples/m2m_100) repository.
8
 
@@ -41,6 +43,17 @@ tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
41
  # => "Life is like a box of chocolate."
42
  ```
43
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  See the [model hub](https://huggingface.co/models?filter=m2m_100) to look for more fine-tuned versions.
46
 
 
3
  ---
4
  # M2M100 418M
5
 
6
+ ***This an ONNX checkpoint exported from [facebook/m2m100_418M](https://huggingface.co/facebook/m2m100_418M) with [🤗 Optimum](https://huggingface.co/docs/optimum/index) v1.14.1***
7
+
8
  M2M100 is a multilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many multilingual translation.
9
  It was introduced in this [paper](https://arxiv.org/abs/2010.11125) and first released in [this](https://github.com/pytorch/fairseq/tree/master/examples/m2m_100) repository.
10
 
 
43
  # => "Life is like a box of chocolate."
44
  ```
45
 
46
+ If the checkpoint is not working correctly, it might be due to recent update in the `🤗 Optimum` library, you could export the checkpoint from PyTorch to ONNX yourself with the following:
47
+
48
+ ```python
49
+ from optimum.onnxruntime import ORTModelForSeq2SeqLM
50
+
51
+ model = ORTModelForSeq2SeqLM.from_pretrained("facebook/m2m100_418M", export=True)
52
+ model.save_pretrained("m2m100_418M/")
53
+ ```
54
+
55
+ Feel free to open a pull request and contribute your update, 🤗 thx!
56
+
57
 
58
  See the [model hub](https://huggingface.co/models?filter=m2m_100) to look for more fine-tuned versions.
59