Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/README-checkpoint.md +98 -0
- .ipynb_checkpoints/eole-config-checkpoint.yaml +94 -0
- README.md +98 -3
- config.json +10 -0
- eole-config.yaml +94 -0
- eole-model/config.json +132 -0
- eole-model/en.spm.model +3 -0
- eole-model/ja.spm.model +3 -0
- eole-model/model.00.safetensors +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,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- ja
|
5 |
+
tags:
|
6 |
+
- translation
|
7 |
+
license: cc-by-4.0
|
8 |
+
datasets:
|
9 |
+
- quickmt/quickmt-train.ja-en
|
10 |
+
model-index:
|
11 |
+
- name: quickmt-en-ja
|
12 |
+
results:
|
13 |
+
- task:
|
14 |
+
name: Translation eng-jpn
|
15 |
+
type: translation
|
16 |
+
args: eng-jpn
|
17 |
+
dataset:
|
18 |
+
name: flores101-devtest
|
19 |
+
type: flores_101
|
20 |
+
args: eng_Latn jpn_Jpan devtest
|
21 |
+
metrics:
|
22 |
+
- name: CHRF
|
23 |
+
type: chrf
|
24 |
+
value: 42.04
|
25 |
+
- name: COMET
|
26 |
+
type: comet
|
27 |
+
value: 89.08
|
28 |
+
---
|
29 |
+
|
30 |
+
|
31 |
+
# `quickmt-en-ja` Neural Machine Translation Model
|
32 |
+
|
33 |
+
`quickmt-en-ja` is a reasonably fast and reasonably accurate neural machine translation model for translation from `en` into `ja`.
|
34 |
+
|
35 |
+
|
36 |
+
## Model Information
|
37 |
+
|
38 |
+
* Trained using [`eole`](https://github.com/eole-nlp/eole)
|
39 |
+
* 185M parameter transformer 'big' with 8 encoder layers and 2 decoder layers
|
40 |
+
* 20k sentencepiece vocabularies
|
41 |
+
* Exported for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format
|
42 |
+
* Training data: https://huggingface.co/datasets/quickmt/quickmt-train.ar-en/tree/main
|
43 |
+
|
44 |
+
See the `eole` model configuration in this repository for further details and the `eole-model` for the raw `eole` (pytorch) model.
|
45 |
+
|
46 |
+
|
47 |
+
## Usage with `quickmt`
|
48 |
+
|
49 |
+
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
50 |
+
|
51 |
+
Next, install the `quickmt` python library and download the model:
|
52 |
+
|
53 |
+
```bash
|
54 |
+
git clone https://github.com/quickmt/quickmt.git
|
55 |
+
pip install ./quickmt/
|
56 |
+
|
57 |
+
quickmt-model-download quickmt/quickmt-en-ja ./quickmt-en-ja
|
58 |
+
```
|
59 |
+
|
60 |
+
Finally use the model in python:
|
61 |
+
|
62 |
+
```python
|
63 |
+
from quickmt import Translator
|
64 |
+
|
65 |
+
# Auto-detects GPU, set to "cpu" to force CPU inference
|
66 |
+
t = Translator("./quickmt-en-ja/", device="auto")
|
67 |
+
|
68 |
+
# Translate - set beam size to 5 for higher quality (but slower speed)
|
69 |
+
sample_text = 'Dr. Ehud Ur, professor of medicine at Dalhousie University in Halifax, Nova Scotia and chair of the clinical and scientific division of the Canadian Diabetes Association cautioned that the research is still in its early days.'
|
70 |
+
t(sample_text, beam_size=5)
|
71 |
+
|
72 |
+
> 'ノバスコシア州ハリファックスのダルハウジー大学の医学教授で、カナダ糖尿病協会の臨床および科学部門の議長であるEhud Ur博士は、研究はまだ初期段階にあると警告しました。'
|
73 |
+
|
74 |
+
# Get alternative translations by sampling
|
75 |
+
# You can pass any cTranslate2 `translate_batch` arguments
|
76 |
+
t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
|
77 |
+
|
78 |
+
> 'ノバスコシア州ハリファックスのダルハウジー大学教授で、カナダ糖尿病学会の臨床、科学部会長のエフド・ウル博士がこの研究はまだその初期段階にあると警告した。'
|
79 |
+
|
80 |
+
```
|
81 |
+
|
82 |
+
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`.
|
83 |
+
|
84 |
+
|
85 |
+
## Metrics
|
86 |
+
|
87 |
+
`chrf2` is calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores) ("eng_Latn"->"jpn_Jpan"). `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 (using `ctranslate2`) the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32 (faster speed is possible using a large batch size).
|
88 |
+
|
89 |
+
| | chrf2 | comet22 | Time (s) |
|
90 |
+
|:---------------------------------|--------:|----------:|-----------:|
|
91 |
+
| quickmt/quickmt-en-ja | 42.04 | 89.08 | 1.38 |
|
92 |
+
| Helsink-NLP/opus-mt-en-ja | 6.41 | 62.91 | 7.09 |
|
93 |
+
| facebook/nllb-200-distilled-600M | 30.00 | 86.64 | 26.05 |
|
94 |
+
| facebook/nllb-200-distilled-1.3B | 32.38 | 88.02 | 46.04 |
|
95 |
+
| facebook/m2m100_418M | 32.73 | 85.09 | 23.29 |
|
96 |
+
| facebook/m2m100_1.2B | 35.83 | 87.78 | 43.89 |
|
97 |
+
|
98 |
+
`quickmt-en-ja` is the fastest and highest quality by a fair margin.
|
.ipynb_checkpoints/eole-config-checkpoint.yaml
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: en.eole.vocab
|
12 |
+
tgt_vocab: ja.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.ja-en/en
|
22 |
+
path_tgt: hf://quickmt/quickmt-train.ja-en/ja
|
23 |
+
path_sco: hf://quickmt/quickmt-train.ja-en/sco
|
24 |
+
valid:
|
25 |
+
path_src: valid.en
|
26 |
+
path_tgt: valid.ja
|
27 |
+
|
28 |
+
transforms: [sentencepiece, filtertoolong]
|
29 |
+
transforms_configs:
|
30 |
+
sentencepiece:
|
31 |
+
src_subword_model: "en.spm.model"
|
32 |
+
tgt_subword_model: "ja.spm.model"
|
33 |
+
filtertoolong:
|
34 |
+
src_seq_length: 256
|
35 |
+
tgt_seq_length: 256
|
36 |
+
|
37 |
+
training:
|
38 |
+
# Run configuration
|
39 |
+
model_path: quickmt-en-ja-eole-model
|
40 |
+
keep_checkpoint: 4
|
41 |
+
train_steps: 100_000
|
42 |
+
save_checkpoint_steps: 5000
|
43 |
+
valid_steps: 5000
|
44 |
+
|
45 |
+
# Train on a single GPU
|
46 |
+
world_size: 1
|
47 |
+
gpu_ranks: [0]
|
48 |
+
|
49 |
+
# Batching 10240
|
50 |
+
batch_type: "tokens"
|
51 |
+
batch_size: 8000
|
52 |
+
valid_batch_size: 4096
|
53 |
+
batch_size_multiple: 8
|
54 |
+
accum_count: [10]
|
55 |
+
accum_steps: [0]
|
56 |
+
|
57 |
+
# Optimizer & Compute
|
58 |
+
compute_dtype: "fp16"
|
59 |
+
optim: "adamw"
|
60 |
+
learning_rate: 2.0
|
61 |
+
warmup_steps: 4000
|
62 |
+
decay_method: "noam"
|
63 |
+
adam_beta2: 0.998
|
64 |
+
|
65 |
+
# Data loading
|
66 |
+
bucket_size: 128000
|
67 |
+
num_workers: 4
|
68 |
+
prefetch_factor: 32
|
69 |
+
|
70 |
+
# Hyperparams
|
71 |
+
dropout_steps: [0]
|
72 |
+
dropout: [0.1]
|
73 |
+
attention_dropout: [0.1]
|
74 |
+
max_grad_norm: 0
|
75 |
+
label_smoothing: 0.1
|
76 |
+
average_decay: 0.0001
|
77 |
+
average_decay: 0
|
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"
|
README.md
CHANGED
@@ -1,3 +1,98 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- ja
|
5 |
+
tags:
|
6 |
+
- translation
|
7 |
+
license: cc-by-4.0
|
8 |
+
datasets:
|
9 |
+
- quickmt/quickmt-train.ja-en
|
10 |
+
model-index:
|
11 |
+
- name: quickmt-en-ja
|
12 |
+
results:
|
13 |
+
- task:
|
14 |
+
name: Translation eng-jpn
|
15 |
+
type: translation
|
16 |
+
args: eng-jpn
|
17 |
+
dataset:
|
18 |
+
name: flores101-devtest
|
19 |
+
type: flores_101
|
20 |
+
args: eng_Latn jpn_Jpan devtest
|
21 |
+
metrics:
|
22 |
+
- name: CHRF
|
23 |
+
type: chrf
|
24 |
+
value: 42.04
|
25 |
+
- name: COMET
|
26 |
+
type: comet
|
27 |
+
value: 89.08
|
28 |
+
---
|
29 |
+
|
30 |
+
|
31 |
+
# `quickmt-en-ja` Neural Machine Translation Model
|
32 |
+
|
33 |
+
`quickmt-en-ja` is a reasonably fast and reasonably accurate neural machine translation model for translation from `en` into `ja`.
|
34 |
+
|
35 |
+
|
36 |
+
## Model Information
|
37 |
+
|
38 |
+
* Trained using [`eole`](https://github.com/eole-nlp/eole)
|
39 |
+
* 185M parameter transformer 'big' with 8 encoder layers and 2 decoder layers
|
40 |
+
* 20k sentencepiece vocabularies
|
41 |
+
* Exported for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format
|
42 |
+
* Training data: https://huggingface.co/datasets/quickmt/quickmt-train.ar-en/tree/main
|
43 |
+
|
44 |
+
See the `eole` model configuration in this repository for further details and the `eole-model` for the raw `eole` (pytorch) model.
|
45 |
+
|
46 |
+
|
47 |
+
## Usage with `quickmt`
|
48 |
+
|
49 |
+
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
50 |
+
|
51 |
+
Next, install the `quickmt` python library and download the model:
|
52 |
+
|
53 |
+
```bash
|
54 |
+
git clone https://github.com/quickmt/quickmt.git
|
55 |
+
pip install ./quickmt/
|
56 |
+
|
57 |
+
quickmt-model-download quickmt/quickmt-en-ja ./quickmt-en-ja
|
58 |
+
```
|
59 |
+
|
60 |
+
Finally use the model in python:
|
61 |
+
|
62 |
+
```python
|
63 |
+
from quickmt import Translator
|
64 |
+
|
65 |
+
# Auto-detects GPU, set to "cpu" to force CPU inference
|
66 |
+
t = Translator("./quickmt-en-ja/", device="auto")
|
67 |
+
|
68 |
+
# Translate - set beam size to 5 for higher quality (but slower speed)
|
69 |
+
sample_text = 'Dr. Ehud Ur, professor of medicine at Dalhousie University in Halifax, Nova Scotia and chair of the clinical and scientific division of the Canadian Diabetes Association cautioned that the research is still in its early days.'
|
70 |
+
t(sample_text, beam_size=5)
|
71 |
+
|
72 |
+
> 'ノバスコシア州ハリファックスのダルハウジー大学の医学教授で、カナダ糖尿病協会の臨床および科学部門の議長であるEhud Ur博士は、研究はまだ初期段階にあると警告しました。'
|
73 |
+
|
74 |
+
# Get alternative translations by sampling
|
75 |
+
# You can pass any cTranslate2 `translate_batch` arguments
|
76 |
+
t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
|
77 |
+
|
78 |
+
> 'ノバスコシア州ハリファックスのダルハウジー大学教授で、カナダ糖尿病学会の臨床、科学部会長のエフド・ウル博士がこの研究はまだその初期段階にあると警告した。'
|
79 |
+
|
80 |
+
```
|
81 |
+
|
82 |
+
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`.
|
83 |
+
|
84 |
+
|
85 |
+
## Metrics
|
86 |
+
|
87 |
+
`chrf2` is calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores) ("eng_Latn"->"jpn_Jpan"). `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 (using `ctranslate2`) the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32 (faster speed is possible using a large batch size).
|
88 |
+
|
89 |
+
| | chrf2 | comet22 | Time (s) |
|
90 |
+
|:---------------------------------|--------:|----------:|-----------:|
|
91 |
+
| quickmt/quickmt-en-ja | 42.04 | 89.08 | 1.38 |
|
92 |
+
| Helsink-NLP/opus-mt-en-ja | 6.41 | 62.91 | 7.09 |
|
93 |
+
| facebook/nllb-200-distilled-600M | 30.00 | 86.64 | 26.05 |
|
94 |
+
| facebook/nllb-200-distilled-1.3B | 32.38 | 88.02 | 46.04 |
|
95 |
+
| facebook/m2m100_418M | 32.73 | 85.09 | 23.29 |
|
96 |
+
| facebook/m2m100_1.2B | 35.83 | 87.78 | 43.89 |
|
97 |
+
|
98 |
+
`quickmt-en-ja` is the fastest and highest quality by a fair margin.
|
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,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: en.eole.vocab
|
12 |
+
tgt_vocab: ja.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.ja-en/en
|
22 |
+
path_tgt: hf://quickmt/quickmt-train.ja-en/ja
|
23 |
+
path_sco: hf://quickmt/quickmt-train.ja-en/sco
|
24 |
+
valid:
|
25 |
+
path_src: valid.en
|
26 |
+
path_tgt: valid.ja
|
27 |
+
|
28 |
+
transforms: [sentencepiece, filtertoolong]
|
29 |
+
transforms_configs:
|
30 |
+
sentencepiece:
|
31 |
+
src_subword_model: "en.spm.model"
|
32 |
+
tgt_subword_model: "ja.spm.model"
|
33 |
+
filtertoolong:
|
34 |
+
src_seq_length: 256
|
35 |
+
tgt_seq_length: 256
|
36 |
+
|
37 |
+
training:
|
38 |
+
# Run configuration
|
39 |
+
model_path: quickmt-en-ja-eole-model
|
40 |
+
keep_checkpoint: 4
|
41 |
+
train_steps: 100_000
|
42 |
+
save_checkpoint_steps: 5000
|
43 |
+
valid_steps: 5000
|
44 |
+
|
45 |
+
# Train on a single GPU
|
46 |
+
world_size: 1
|
47 |
+
gpu_ranks: [0]
|
48 |
+
|
49 |
+
# Batching 10240
|
50 |
+
batch_type: "tokens"
|
51 |
+
batch_size: 8000
|
52 |
+
valid_batch_size: 4096
|
53 |
+
batch_size_multiple: 8
|
54 |
+
accum_count: [10]
|
55 |
+
accum_steps: [0]
|
56 |
+
|
57 |
+
# Optimizer & Compute
|
58 |
+
compute_dtype: "fp16"
|
59 |
+
optim: "adamw"
|
60 |
+
learning_rate: 2.0
|
61 |
+
warmup_steps: 4000
|
62 |
+
decay_method: "noam"
|
63 |
+
adam_beta2: 0.998
|
64 |
+
|
65 |
+
# Data loading
|
66 |
+
bucket_size: 128000
|
67 |
+
num_workers: 4
|
68 |
+
prefetch_factor: 32
|
69 |
+
|
70 |
+
# Hyperparams
|
71 |
+
dropout_steps: [0]
|
72 |
+
dropout: [0.1]
|
73 |
+
attention_dropout: [0.1]
|
74 |
+
max_grad_norm: 0
|
75 |
+
label_smoothing: 0.1
|
76 |
+
average_decay: 0.0001
|
77 |
+
average_decay: 0
|
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"
|
eole-model/config.json
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"tensorboard_log_dir": "tensorboard",
|
3 |
+
"tgt_vocab": "ja.eole.vocab",
|
4 |
+
"share_vocab": false,
|
5 |
+
"vocab_size_multiple": 8,
|
6 |
+
"n_sample": 0,
|
7 |
+
"src_vocab": "en.eole.vocab",
|
8 |
+
"transforms": [
|
9 |
+
"sentencepiece",
|
10 |
+
"filtertoolong"
|
11 |
+
],
|
12 |
+
"report_every": 100,
|
13 |
+
"tgt_vocab_size": 20000,
|
14 |
+
"tensorboard_log_dir_dated": "tensorboard/Apr-17_21-24-27",
|
15 |
+
"save_data": "data",
|
16 |
+
"src_vocab_size": 20000,
|
17 |
+
"overwrite": true,
|
18 |
+
"tensorboard": true,
|
19 |
+
"valid_metrics": [
|
20 |
+
"BLEU"
|
21 |
+
],
|
22 |
+
"seed": 1234,
|
23 |
+
"training": {
|
24 |
+
"attention_dropout": [
|
25 |
+
0.1
|
26 |
+
],
|
27 |
+
"dropout_steps": [
|
28 |
+
0
|
29 |
+
],
|
30 |
+
"normalization": "tokens",
|
31 |
+
"max_grad_norm": 0.0,
|
32 |
+
"decay_method": "noam",
|
33 |
+
"bucket_size": 128000,
|
34 |
+
"average_decay": 0.0,
|
35 |
+
"prefetch_factor": 32,
|
36 |
+
"learning_rate": 2.0,
|
37 |
+
"valid_batch_size": 4096,
|
38 |
+
"optim": "adamw",
|
39 |
+
"warmup_steps": 4000,
|
40 |
+
"adam_beta2": 0.998,
|
41 |
+
"batch_type": "tokens",
|
42 |
+
"num_workers": 0,
|
43 |
+
"save_checkpoint_steps": 5000,
|
44 |
+
"param_init_method": "xavier_uniform",
|
45 |
+
"accum_steps": [
|
46 |
+
0
|
47 |
+
],
|
48 |
+
"train_steps": 100000,
|
49 |
+
"gpu_ranks": [
|
50 |
+
0
|
51 |
+
],
|
52 |
+
"model_path": "quickmt-en-ja-eole-model",
|
53 |
+
"dropout": [
|
54 |
+
0.1
|
55 |
+
],
|
56 |
+
"compute_dtype": "torch.float16",
|
57 |
+
"keep_checkpoint": 4,
|
58 |
+
"batch_size": 8000,
|
59 |
+
"valid_steps": 5000,
|
60 |
+
"world_size": 1,
|
61 |
+
"accum_count": [
|
62 |
+
10
|
63 |
+
],
|
64 |
+
"batch_size_multiple": 8,
|
65 |
+
"label_smoothing": 0.1
|
66 |
+
},
|
67 |
+
"data": {
|
68 |
+
"corpus_1": {
|
69 |
+
"path_src": "en.txt",
|
70 |
+
"path_tgt": "ja.txt",
|
71 |
+
"transforms": [
|
72 |
+
"sentencepiece",
|
73 |
+
"filtertoolong"
|
74 |
+
],
|
75 |
+
"path_align": null
|
76 |
+
},
|
77 |
+
"valid": {
|
78 |
+
"path_src": "valid.en",
|
79 |
+
"path_tgt": "valid.ja",
|
80 |
+
"transforms": [
|
81 |
+
"sentencepiece",
|
82 |
+
"filtertoolong"
|
83 |
+
],
|
84 |
+
"path_align": null
|
85 |
+
}
|
86 |
+
},
|
87 |
+
"transforms_configs": {
|
88 |
+
"sentencepiece": {
|
89 |
+
"src_subword_model": "${MODEL_PATH}/en.spm.model",
|
90 |
+
"tgt_subword_model": "${MODEL_PATH}/ja.spm.model"
|
91 |
+
},
|
92 |
+
"filtertoolong": {
|
93 |
+
"tgt_seq_length": 256,
|
94 |
+
"src_seq_length": 256
|
95 |
+
}
|
96 |
+
},
|
97 |
+
"model": {
|
98 |
+
"hidden_size": 1024,
|
99 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
100 |
+
"architecture": "transformer",
|
101 |
+
"heads": 8,
|
102 |
+
"transformer_ff": 4096,
|
103 |
+
"share_embeddings": false,
|
104 |
+
"share_decoder_embeddings": false,
|
105 |
+
"encoder": {
|
106 |
+
"n_positions": null,
|
107 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
108 |
+
"heads": 8,
|
109 |
+
"encoder_type": "transformer",
|
110 |
+
"layers": 8,
|
111 |
+
"transformer_ff": 4096,
|
112 |
+
"hidden_size": 1024,
|
113 |
+
"src_word_vec_size": 1024
|
114 |
+
},
|
115 |
+
"embeddings": {
|
116 |
+
"tgt_word_vec_size": 1024,
|
117 |
+
"word_vec_size": 1024,
|
118 |
+
"src_word_vec_size": 1024,
|
119 |
+
"position_encoding_type": "SinusoidalInterleaved"
|
120 |
+
},
|
121 |
+
"decoder": {
|
122 |
+
"n_positions": null,
|
123 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
124 |
+
"heads": 8,
|
125 |
+
"layers": 2,
|
126 |
+
"tgt_word_vec_size": 1024,
|
127 |
+
"decoder_type": "transformer",
|
128 |
+
"transformer_ff": 4096,
|
129 |
+
"hidden_size": 1024
|
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:01dc857df9df5987bec61812d1fbc2e78ad530346c09fe3ffaf27184358ab8fd
|
3 |
+
size 583983
|
eole-model/ja.spm.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cbd449d7e92d850f6d36efeafb40cea3a8468f55db0ca751ee4ece0ceb70d19b
|
3 |
+
size 583133
|
eole-model/model.00.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:849b2522c07b3c8f88f2ceda83476616dbb4299c5e8bbe926ba516347ef2fb51
|
3 |
+
size 823882912
|
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:a2653ed557273846433473e87bc35e482d956dd529be02faafc0ab9597816585
|
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:01dc857df9df5987bec61812d1fbc2e78ad530346c09fe3ffaf27184358ab8fd
|
3 |
+
size 583983
|
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:cbd449d7e92d850f6d36efeafb40cea3a8468f55db0ca751ee4ece0ceb70d19b
|
3 |
+
size 583133
|