Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/README-checkpoint.md +100 -0
- .ipynb_checkpoints/eole-config-checkpoint.yaml +95 -0
- README.md +100 -3
- config.json +10 -0
- eole-config.yaml +95 -0
- eole-model/config.json +132 -0
- eole-model/en.spm.model +3 -0
- eole-model/model.00.safetensors +3 -0
- eole-model/vi.spm.model +3 -0
- eole-model/vocab.json +0 -0
- model.bin +3 -0
- source_vocabulary.json +0 -0
- src.spm.model +3 -0
- target_vocabulary.json +0 -0
- tgt.spm.model +3 -0
.ipynb_checkpoints/README-checkpoint.md
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- vi
|
5 |
+
tags:
|
6 |
+
- translation
|
7 |
+
license: cc-by-4.0
|
8 |
+
datasets:
|
9 |
+
- quickmt/quickmt-train.vi-en
|
10 |
+
model-index:
|
11 |
+
- name: quickmt-vi-en
|
12 |
+
results:
|
13 |
+
- task:
|
14 |
+
name: Translation vie-eng
|
15 |
+
type: translation
|
16 |
+
args: vie-eng
|
17 |
+
dataset:
|
18 |
+
name: flores101-devtest
|
19 |
+
type: flores_101
|
20 |
+
args: vie_Latn eng_Latn devtest
|
21 |
+
metrics:
|
22 |
+
- name: BLEU
|
23 |
+
type: bleu
|
24 |
+
value: 37.6
|
25 |
+
- name: CHRF
|
26 |
+
type: chrf
|
27 |
+
value: 62.86
|
28 |
+
- name: COMET
|
29 |
+
type: comet
|
30 |
+
value: 87.21
|
31 |
+
---
|
32 |
+
|
33 |
+
|
34 |
+
# `quickmt-vi-en` Neural Machine Translation Model
|
35 |
+
|
36 |
+
`quickmt-vi-en` is a reasonably fast and reasonably accurate neural machine translation model for translation from `vi` into `en`.
|
37 |
+
|
38 |
+
|
39 |
+
## Model Information
|
40 |
+
|
41 |
+
* Trained using [`eole`](https://github.com/eole-nlp/eole)
|
42 |
+
* 185M parameter transformer 'big' with 8 encoder layers and 2 decoder layers
|
43 |
+
* 50k joint Sentencepiece vocabulary
|
44 |
+
* Expested for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format
|
45 |
+
* Training data: https://huggingface.co/datasets/quickmt/quickmt-train.vi-en/tree/main
|
46 |
+
|
47 |
+
See the `eole` model configuration in this repository for further details and the `eole-model` for the raw `eole` (pytorch) model.
|
48 |
+
|
49 |
+
## Usage with `quickmt`
|
50 |
+
|
51 |
+
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
52 |
+
|
53 |
+
Next, install the `quickmt` python library and download the model:
|
54 |
+
|
55 |
+
```bash
|
56 |
+
git clone https://github.com/quickmt/quickmt.git
|
57 |
+
pip install ./quickmt/
|
58 |
+
|
59 |
+
quickmt-model-download quickmt/quickmt-vi-en ./quickmt-vi-en
|
60 |
+
```
|
61 |
+
|
62 |
+
Finally use the model in python:
|
63 |
+
|
64 |
+
```python
|
65 |
+
from quickmt impest Translator
|
66 |
+
|
67 |
+
# Auto-detects GPU, set to "cpu" to force CPU inference
|
68 |
+
t = Translator("./quickmt-vi-en/", device="auto")
|
69 |
+
|
70 |
+
# Translate - set beam size to 1 for faster speed (but lower quality)
|
71 |
+
sample_text = 'Tiến sĩ Ehud Ur, giáo sư y khoa của Trường Đại học Dalhousie ở Halifax, Nova Scotia và là chủ tịch ban lâm sàng và khoa học của Hiệp hội Bệnh Tiểu đường Canada cảnh báo rằng nghiên cứu này chỉ mới là sự khởi đầu.'
|
72 |
+
|
73 |
+
t(sample_text, beam_size=5)
|
74 |
+
```
|
75 |
+
|
76 |
+
> 'Dr. Ehud Ur, a professor of medicine at Dalhousie University in Halifax, Nova Scotia and chair of the clinical and scientific committee of the Canadian Diabetes Association, warns that the study is just the beginning.'
|
77 |
+
|
78 |
+
```python
|
79 |
+
# Get alternative translations by sampling
|
80 |
+
# You can pass any cTranslate2 `translate_batch` arguments
|
81 |
+
t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
|
82 |
+
```
|
83 |
+
|
84 |
+
> 'Dr Ehud Ur, professor of medicine at Dalhousie College in Halifax, Nova Scotia and chair of the clinical and scientific panel of the Diabetes Association of Canada warns that this study was only the beginning.'
|
85 |
+
|
86 |
+
The model is in `ctranslate2` format, and the tokenizers are `sentencepiece`, so you can use `ctranslate2` directly instead of through `quickmt`. It is also possible to get this model to work with e.g. [LibreTranslate](https://libretranslate.com/) which also uses `ctranslate2` and `sentencepiece`.
|
87 |
+
|
88 |
+
## Metrics
|
89 |
+
|
90 |
+
`bleu` and `chrf2` are calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores) ("vie_Latn"->"eng_Latn"). `comet22` with the [`comet`](https://github.com/Unbabel/COMET) library and the [default model](https://huggingface.co/Unbabel/wmt22-comet-da). "Time (s)" is the time in seconds to translate the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32 (faster speed is possible using a larger batch size).
|
91 |
+
|
92 |
+
| | bleu | chrf2 | comet22 | Time (s) |
|
93 |
+
|:---------------------------------|-------:|--------:|----------:|-----------:|
|
94 |
+
| quickmt/quickmt-vi-en | 37.6 | 62.86 | 87.21 | 1.27 |
|
95 |
+
| Helsinki-NLP/opus-mt-vi-en | 25.93 | 53.32 | 81.77 | 3.45 |
|
96 |
+
| facebook/nllb-200-distilled-600M | 34.99 | 60.35 | 86.13 | 24.71 |
|
97 |
+
| facebook/nllb-200-distilled-1.3B | 37.67 | 62.64 | 87.12 | 36.8 |
|
98 |
+
| facebook/m2m100_418M | 27.63 | 55.39 | 82.79 | 17.61 |
|
99 |
+
| facebook/m2m100_1.2B | 32.79 | 59.01 | 85.58 | 33.98 |
|
100 |
+
|
.ipynb_checkpoints/eole-config-checkpoint.yaml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## IO
|
2 |
+
save_data: data
|
3 |
+
overwrite: True
|
4 |
+
seed: 1234
|
5 |
+
report_every: 100
|
6 |
+
valid_metrics: ["BLEU"]
|
7 |
+
tensorboard: true
|
8 |
+
tensorboard_log_dir: tensorboard
|
9 |
+
|
10 |
+
### Vocab
|
11 |
+
src_vocab: vi.eole.vocab
|
12 |
+
tgt_vocab: en.eole.vocab
|
13 |
+
src_vocab_size: 20000
|
14 |
+
tgt_vocab_size: 20000
|
15 |
+
vocab_size_multiple: 8
|
16 |
+
share_vocab: false
|
17 |
+
n_sample: 0
|
18 |
+
|
19 |
+
data:
|
20 |
+
corpus_1:
|
21 |
+
path_src: hf://quickmt/quickmt-train.vi-en/vi
|
22 |
+
path_tgt: hf://quickmt/quickmt-train.vi-en/en
|
23 |
+
path_sco: hf://quickmt/quickmt-train.vi-en/sco
|
24 |
+
valid:
|
25 |
+
path_src: valid.vi
|
26 |
+
path_tgt: valid.en
|
27 |
+
|
28 |
+
transforms: [sentencepiece, filtertoolong]
|
29 |
+
transforms_configs:
|
30 |
+
sentencepiece:
|
31 |
+
src_subword_model: "vi.spm.model"
|
32 |
+
tgt_subword_model: "en.spm.model"
|
33 |
+
filtertoolong:
|
34 |
+
src_seq_length: 256
|
35 |
+
tgt_seq_length: 256
|
36 |
+
|
37 |
+
training:
|
38 |
+
# Run configuration
|
39 |
+
model_path: quickmt-vi-en-eole-model
|
40 |
+
keep_checkpoint: 4
|
41 |
+
train_steps: 200000
|
42 |
+
save_checkpoint_steps: 2000
|
43 |
+
valid_steps: 2000
|
44 |
+
|
45 |
+
# Train on a single GPU
|
46 |
+
world_size: 1
|
47 |
+
gpu_ranks: [0]
|
48 |
+
|
49 |
+
# Batching
|
50 |
+
batch_type: "tokens"
|
51 |
+
batch_size: 8000
|
52 |
+
valid_batch_size: 4096
|
53 |
+
batch_size_multiple: 8
|
54 |
+
accum_count: [8]
|
55 |
+
accum_steps: [0]
|
56 |
+
|
57 |
+
# Optimizer & Compute
|
58 |
+
compute_dtype: "fp16"
|
59 |
+
optim: "adamw"
|
60 |
+
#use_amp: False
|
61 |
+
learning_rate: 2.0
|
62 |
+
warmup_steps: 4000
|
63 |
+
decay_method: "noam"
|
64 |
+
adam_beta2: 0.998
|
65 |
+
|
66 |
+
# Data loading
|
67 |
+
bucket_size: 128000
|
68 |
+
num_workers: 4
|
69 |
+
prefetch_factor: 32
|
70 |
+
|
71 |
+
# Hyperparams
|
72 |
+
dropout_steps: [0]
|
73 |
+
dropout: [0.1]
|
74 |
+
attention_dropout: [0.1]
|
75 |
+
max_grad_norm: 0
|
76 |
+
label_smoothing: 0.1
|
77 |
+
average_decay: 0.0001
|
78 |
+
param_init_method: xavier_uniform
|
79 |
+
normalization: "tokens"
|
80 |
+
|
81 |
+
model:
|
82 |
+
architecture: "transformer"
|
83 |
+
share_embeddings: false
|
84 |
+
share_decoder_embeddings: false
|
85 |
+
hidden_size: 1024
|
86 |
+
encoder:
|
87 |
+
layers: 8
|
88 |
+
decoder:
|
89 |
+
layers: 2
|
90 |
+
heads: 8
|
91 |
+
transformer_ff: 4096
|
92 |
+
embeddings:
|
93 |
+
word_vec_size: 1024
|
94 |
+
position_encoding_type: "SinusoidalInterleaved"
|
95 |
+
|
README.md
CHANGED
@@ -1,3 +1,100 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- vi
|
5 |
+
tags:
|
6 |
+
- translation
|
7 |
+
license: cc-by-4.0
|
8 |
+
datasets:
|
9 |
+
- quickmt/quickmt-train.vi-en
|
10 |
+
model-index:
|
11 |
+
- name: quickmt-vi-en
|
12 |
+
results:
|
13 |
+
- task:
|
14 |
+
name: Translation vie-eng
|
15 |
+
type: translation
|
16 |
+
args: vie-eng
|
17 |
+
dataset:
|
18 |
+
name: flores101-devtest
|
19 |
+
type: flores_101
|
20 |
+
args: vie_Latn eng_Latn devtest
|
21 |
+
metrics:
|
22 |
+
- name: BLEU
|
23 |
+
type: bleu
|
24 |
+
value: 37.6
|
25 |
+
- name: CHRF
|
26 |
+
type: chrf
|
27 |
+
value: 62.86
|
28 |
+
- name: COMET
|
29 |
+
type: comet
|
30 |
+
value: 87.21
|
31 |
+
---
|
32 |
+
|
33 |
+
|
34 |
+
# `quickmt-vi-en` Neural Machine Translation Model
|
35 |
+
|
36 |
+
`quickmt-vi-en` is a reasonably fast and reasonably accurate neural machine translation model for translation from `vi` into `en`.
|
37 |
+
|
38 |
+
|
39 |
+
## Model Information
|
40 |
+
|
41 |
+
* Trained using [`eole`](https://github.com/eole-nlp/eole)
|
42 |
+
* 185M parameter transformer 'big' with 8 encoder layers and 2 decoder layers
|
43 |
+
* 50k joint Sentencepiece vocabulary
|
44 |
+
* Expested for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format
|
45 |
+
* Training data: https://huggingface.co/datasets/quickmt/quickmt-train.vi-en/tree/main
|
46 |
+
|
47 |
+
See the `eole` model configuration in this repository for further details and the `eole-model` for the raw `eole` (pytorch) model.
|
48 |
+
|
49 |
+
## Usage with `quickmt`
|
50 |
+
|
51 |
+
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
52 |
+
|
53 |
+
Next, install the `quickmt` python library and download the model:
|
54 |
+
|
55 |
+
```bash
|
56 |
+
git clone https://github.com/quickmt/quickmt.git
|
57 |
+
pip install ./quickmt/
|
58 |
+
|
59 |
+
quickmt-model-download quickmt/quickmt-vi-en ./quickmt-vi-en
|
60 |
+
```
|
61 |
+
|
62 |
+
Finally use the model in python:
|
63 |
+
|
64 |
+
```python
|
65 |
+
from quickmt impest Translator
|
66 |
+
|
67 |
+
# Auto-detects GPU, set to "cpu" to force CPU inference
|
68 |
+
t = Translator("./quickmt-vi-en/", device="auto")
|
69 |
+
|
70 |
+
# Translate - set beam size to 1 for faster speed (but lower quality)
|
71 |
+
sample_text = 'Tiến sĩ Ehud Ur, giáo sư y khoa của Trường Đại học Dalhousie ở Halifax, Nova Scotia và là chủ tịch ban lâm sàng và khoa học của Hiệp hội Bệnh Tiểu đường Canada cảnh báo rằng nghiên cứu này chỉ mới là sự khởi đầu.'
|
72 |
+
|
73 |
+
t(sample_text, beam_size=5)
|
74 |
+
```
|
75 |
+
|
76 |
+
> 'Dr. Ehud Ur, a professor of medicine at Dalhousie University in Halifax, Nova Scotia and chair of the clinical and scientific committee of the Canadian Diabetes Association, warns that the study is just the beginning.'
|
77 |
+
|
78 |
+
```python
|
79 |
+
# Get alternative translations by sampling
|
80 |
+
# You can pass any cTranslate2 `translate_batch` arguments
|
81 |
+
t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
|
82 |
+
```
|
83 |
+
|
84 |
+
> 'Dr Ehud Ur, professor of medicine at Dalhousie College in Halifax, Nova Scotia and chair of the clinical and scientific panel of the Diabetes Association of Canada warns that this study was only the beginning.'
|
85 |
+
|
86 |
+
The model is in `ctranslate2` format, and the tokenizers are `sentencepiece`, so you can use `ctranslate2` directly instead of through `quickmt`. It is also possible to get this model to work with e.g. [LibreTranslate](https://libretranslate.com/) which also uses `ctranslate2` and `sentencepiece`.
|
87 |
+
|
88 |
+
## Metrics
|
89 |
+
|
90 |
+
`bleu` and `chrf2` are calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores) ("vie_Latn"->"eng_Latn"). `comet22` with the [`comet`](https://github.com/Unbabel/COMET) library and the [default model](https://huggingface.co/Unbabel/wmt22-comet-da). "Time (s)" is the time in seconds to translate the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32 (faster speed is possible using a larger batch size).
|
91 |
+
|
92 |
+
| | bleu | chrf2 | comet22 | Time (s) |
|
93 |
+
|:---------------------------------|-------:|--------:|----------:|-----------:|
|
94 |
+
| quickmt/quickmt-vi-en | 37.6 | 62.86 | 87.21 | 1.27 |
|
95 |
+
| Helsinki-NLP/opus-mt-vi-en | 25.93 | 53.32 | 81.77 | 3.45 |
|
96 |
+
| facebook/nllb-200-distilled-600M | 34.99 | 60.35 | 86.13 | 24.71 |
|
97 |
+
| facebook/nllb-200-distilled-1.3B | 37.67 | 62.64 | 87.12 | 36.8 |
|
98 |
+
| facebook/m2m100_418M | 27.63 | 55.39 | 82.79 | 17.61 |
|
99 |
+
| facebook/m2m100_1.2B | 32.79 | 59.01 | 85.58 | 33.98 |
|
100 |
+
|
config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_source_bos": false,
|
3 |
+
"add_source_eos": false,
|
4 |
+
"bos_token": "<s>",
|
5 |
+
"decoder_start_token": "<s>",
|
6 |
+
"eos_token": "</s>",
|
7 |
+
"layer_norm_epsilon": 1e-06,
|
8 |
+
"multi_query_attention": false,
|
9 |
+
"unk_token": "<unk>"
|
10 |
+
}
|
eole-config.yaml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## IO
|
2 |
+
save_data: data
|
3 |
+
overwrite: True
|
4 |
+
seed: 1234
|
5 |
+
report_every: 100
|
6 |
+
valid_metrics: ["BLEU"]
|
7 |
+
tensorboard: true
|
8 |
+
tensorboard_log_dir: tensorboard
|
9 |
+
|
10 |
+
### Vocab
|
11 |
+
src_vocab: vi.eole.vocab
|
12 |
+
tgt_vocab: en.eole.vocab
|
13 |
+
src_vocab_size: 20000
|
14 |
+
tgt_vocab_size: 20000
|
15 |
+
vocab_size_multiple: 8
|
16 |
+
share_vocab: false
|
17 |
+
n_sample: 0
|
18 |
+
|
19 |
+
data:
|
20 |
+
corpus_1:
|
21 |
+
path_src: hf://quickmt/quickmt-train.vi-en/vi
|
22 |
+
path_tgt: hf://quickmt/quickmt-train.vi-en/en
|
23 |
+
path_sco: hf://quickmt/quickmt-train.vi-en/sco
|
24 |
+
valid:
|
25 |
+
path_src: valid.vi
|
26 |
+
path_tgt: valid.en
|
27 |
+
|
28 |
+
transforms: [sentencepiece, filtertoolong]
|
29 |
+
transforms_configs:
|
30 |
+
sentencepiece:
|
31 |
+
src_subword_model: "vi.spm.model"
|
32 |
+
tgt_subword_model: "en.spm.model"
|
33 |
+
filtertoolong:
|
34 |
+
src_seq_length: 256
|
35 |
+
tgt_seq_length: 256
|
36 |
+
|
37 |
+
training:
|
38 |
+
# Run configuration
|
39 |
+
model_path: quickmt-vi-en-eole-model
|
40 |
+
keep_checkpoint: 4
|
41 |
+
train_steps: 200000
|
42 |
+
save_checkpoint_steps: 2000
|
43 |
+
valid_steps: 2000
|
44 |
+
|
45 |
+
# Train on a single GPU
|
46 |
+
world_size: 1
|
47 |
+
gpu_ranks: [0]
|
48 |
+
|
49 |
+
# Batching
|
50 |
+
batch_type: "tokens"
|
51 |
+
batch_size: 8000
|
52 |
+
valid_batch_size: 4096
|
53 |
+
batch_size_multiple: 8
|
54 |
+
accum_count: [8]
|
55 |
+
accum_steps: [0]
|
56 |
+
|
57 |
+
# Optimizer & Compute
|
58 |
+
compute_dtype: "fp16"
|
59 |
+
optim: "adamw"
|
60 |
+
#use_amp: False
|
61 |
+
learning_rate: 2.0
|
62 |
+
warmup_steps: 4000
|
63 |
+
decay_method: "noam"
|
64 |
+
adam_beta2: 0.998
|
65 |
+
|
66 |
+
# Data loading
|
67 |
+
bucket_size: 128000
|
68 |
+
num_workers: 4
|
69 |
+
prefetch_factor: 32
|
70 |
+
|
71 |
+
# Hyperparams
|
72 |
+
dropout_steps: [0]
|
73 |
+
dropout: [0.1]
|
74 |
+
attention_dropout: [0.1]
|
75 |
+
max_grad_norm: 0
|
76 |
+
label_smoothing: 0.1
|
77 |
+
average_decay: 0.0001
|
78 |
+
param_init_method: xavier_uniform
|
79 |
+
normalization: "tokens"
|
80 |
+
|
81 |
+
model:
|
82 |
+
architecture: "transformer"
|
83 |
+
share_embeddings: false
|
84 |
+
share_decoder_embeddings: false
|
85 |
+
hidden_size: 1024
|
86 |
+
encoder:
|
87 |
+
layers: 8
|
88 |
+
decoder:
|
89 |
+
layers: 2
|
90 |
+
heads: 8
|
91 |
+
transformer_ff: 4096
|
92 |
+
embeddings:
|
93 |
+
word_vec_size: 1024
|
94 |
+
position_encoding_type: "SinusoidalInterleaved"
|
95 |
+
|
eole-model/config.json
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"src_vocab": "vi.eole.vocab",
|
3 |
+
"share_vocab": false,
|
4 |
+
"report_every": 100,
|
5 |
+
"tensorboard": true,
|
6 |
+
"overwrite": true,
|
7 |
+
"seed": 1234,
|
8 |
+
"tensorboard_log_dir": "tensorboard",
|
9 |
+
"src_vocab_size": 20000,
|
10 |
+
"tgt_vocab": "en.eole.vocab",
|
11 |
+
"tensorboard_log_dir_dated": "tensorboard/Jul-09_09-03-58",
|
12 |
+
"vocab_size_multiple": 8,
|
13 |
+
"save_data": "data",
|
14 |
+
"valid_metrics": [
|
15 |
+
"BLEU"
|
16 |
+
],
|
17 |
+
"tgt_vocab_size": 20000,
|
18 |
+
"n_sample": 0,
|
19 |
+
"transforms": [
|
20 |
+
"sentencepiece",
|
21 |
+
"filtertoolong"
|
22 |
+
],
|
23 |
+
"training": {
|
24 |
+
"num_workers": 0,
|
25 |
+
"accum_steps": [
|
26 |
+
0
|
27 |
+
],
|
28 |
+
"valid_steps": 2000,
|
29 |
+
"decay_method": "noam",
|
30 |
+
"bucket_size": 128000,
|
31 |
+
"batch_size_multiple": 8,
|
32 |
+
"warmup_steps": 4000,
|
33 |
+
"param_init_method": "xavier_uniform",
|
34 |
+
"optim": "adamw",
|
35 |
+
"accum_count": [
|
36 |
+
8
|
37 |
+
],
|
38 |
+
"compute_dtype": "torch.float16",
|
39 |
+
"attention_dropout": [
|
40 |
+
0.1
|
41 |
+
],
|
42 |
+
"adam_beta2": 0.998,
|
43 |
+
"gpu_ranks": [
|
44 |
+
0
|
45 |
+
],
|
46 |
+
"label_smoothing": 0.1,
|
47 |
+
"dropout": [
|
48 |
+
0.1
|
49 |
+
],
|
50 |
+
"prefetch_factor": 32,
|
51 |
+
"world_size": 1,
|
52 |
+
"batch_type": "tokens",
|
53 |
+
"learning_rate": 2.0,
|
54 |
+
"keep_checkpoint": 4,
|
55 |
+
"average_decay": 0.0001,
|
56 |
+
"train_steps": 200000,
|
57 |
+
"save_checkpoint_steps": 2000,
|
58 |
+
"normalization": "tokens",
|
59 |
+
"batch_size": 8000,
|
60 |
+
"valid_batch_size": 4096,
|
61 |
+
"model_path": "quickmt-vi-en-eole-model",
|
62 |
+
"dropout_steps": [
|
63 |
+
0
|
64 |
+
],
|
65 |
+
"max_grad_norm": 0.0
|
66 |
+
},
|
67 |
+
"model": {
|
68 |
+
"hidden_size": 1024,
|
69 |
+
"share_decoder_embeddings": false,
|
70 |
+
"heads": 8,
|
71 |
+
"transformer_ff": 4096,
|
72 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
73 |
+
"share_embeddings": false,
|
74 |
+
"architecture": "transformer",
|
75 |
+
"encoder": {
|
76 |
+
"layers": 8,
|
77 |
+
"hidden_size": 1024,
|
78 |
+
"heads": 8,
|
79 |
+
"transformer_ff": 4096,
|
80 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
81 |
+
"src_word_vec_size": 1024,
|
82 |
+
"encoder_type": "transformer",
|
83 |
+
"n_positions": null
|
84 |
+
},
|
85 |
+
"decoder": {
|
86 |
+
"decoder_type": "transformer",
|
87 |
+
"layers": 2,
|
88 |
+
"hidden_size": 1024,
|
89 |
+
"heads": 8,
|
90 |
+
"transformer_ff": 4096,
|
91 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
92 |
+
"tgt_word_vec_size": 1024,
|
93 |
+
"n_positions": null
|
94 |
+
},
|
95 |
+
"embeddings": {
|
96 |
+
"src_word_vec_size": 1024,
|
97 |
+
"word_vec_size": 1024,
|
98 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
99 |
+
"tgt_word_vec_size": 1024
|
100 |
+
}
|
101 |
+
},
|
102 |
+
"transforms_configs": {
|
103 |
+
"sentencepiece": {
|
104 |
+
"src_subword_model": "${MODEL_PATH}/vi.spm.model",
|
105 |
+
"tgt_subword_model": "${MODEL_PATH}/en.spm.model"
|
106 |
+
},
|
107 |
+
"filtertoolong": {
|
108 |
+
"tgt_seq_length": 256,
|
109 |
+
"src_seq_length": 256
|
110 |
+
}
|
111 |
+
},
|
112 |
+
"data": {
|
113 |
+
"corpus_1": {
|
114 |
+
"path_src": "train.vi",
|
115 |
+
"path_tgt": "train.en",
|
116 |
+
"path_align": null,
|
117 |
+
"transforms": [
|
118 |
+
"sentencepiece",
|
119 |
+
"filtertoolong"
|
120 |
+
]
|
121 |
+
},
|
122 |
+
"valid": {
|
123 |
+
"path_src": "valid.vi",
|
124 |
+
"path_tgt": "valid.en",
|
125 |
+
"path_align": null,
|
126 |
+
"transforms": [
|
127 |
+
"sentencepiece",
|
128 |
+
"filtertoolong"
|
129 |
+
]
|
130 |
+
}
|
131 |
+
}
|
132 |
+
}
|
eole-model/en.spm.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:82efd76a945ec4574b2ab3d2476b0043a9737c8dbe693cd20a7fa036d273c0eb
|
3 |
+
size 586058
|
eole-model/model.00.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b7a913bf69c3e4008816ab744664912f35f3d95e22ab0bb9826df90805ae7b3
|
3 |
+
size 823882912
|
eole-model/vi.spm.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:03be7f771990d2bee00d7ff09219baad95b53fef1dcd387b3048c156d665e046
|
3 |
+
size 553521
|
eole-model/vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf9297acc4339155f44430bdaf622700a3db2709de9d7ce4da6755ae5cacfb79
|
3 |
+
size 401699775
|
source_vocabulary.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
src.spm.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:03be7f771990d2bee00d7ff09219baad95b53fef1dcd387b3048c156d665e046
|
3 |
+
size 553521
|
target_vocabulary.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tgt.spm.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:82efd76a945ec4574b2ab3d2476b0043a9737c8dbe693cd20a7fa036d273c0eb
|
3 |
+
size 586058
|