Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/README-checkpoint.md +100 -0
- README.md +100 -3
- config.json +10 -0
- eole-config.yaml +105 -0
- eole-model/config.json +150 -0
- eole-model/model.00.safetensors +3 -0
- eole-model/src.spm.model +3 -0
- eole-model/tgt.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 |
+
- ko
|
| 5 |
+
tags:
|
| 6 |
+
- translation
|
| 7 |
+
license: cc-by-4.0
|
| 8 |
+
datasets:
|
| 9 |
+
- quickmt/quickmt-train.ko-en
|
| 10 |
+
model-index:
|
| 11 |
+
- name: quickmt-ko-en
|
| 12 |
+
results:
|
| 13 |
+
- task:
|
| 14 |
+
name: Translation kor-eng
|
| 15 |
+
type: translation
|
| 16 |
+
args: kor-eng
|
| 17 |
+
dataset:
|
| 18 |
+
name: flores101-devtest
|
| 19 |
+
type: flores_101
|
| 20 |
+
args: kor_Hang eng_Latn devtest
|
| 21 |
+
metrics:
|
| 22 |
+
- name: CHRF
|
| 23 |
+
type: chrf
|
| 24 |
+
value: 56.25
|
| 25 |
+
- name: BLEU
|
| 26 |
+
type: bleu
|
| 27 |
+
value: 27.03
|
| 28 |
+
- name: COMET
|
| 29 |
+
type: comet
|
| 30 |
+
value: 86.11
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# `quickmt-ko-en` Neural Machine Translation Model
|
| 35 |
+
|
| 36 |
+
`quickmt-ko-en` is a reasonably fast and reasonably accurate neural machine translation model for translation from `ko` 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 |
+
* 20k sentencepiece vocabularies
|
| 44 |
+
* Exported for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format
|
| 45 |
+
* Training data: https://huggingface.co/datasets/quickmt/quickmt-train.ko-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 |
+
|
| 50 |
+
## Usage with `quickmt`
|
| 51 |
+
|
| 52 |
+
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
| 53 |
+
|
| 54 |
+
Next, install the `quickmt` python library and download the model:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
git clone https://github.com/quickmt/quickmt.git
|
| 58 |
+
pip install ./quickmt/
|
| 59 |
+
|
| 60 |
+
quickmt-model-download quickmt/quickmt-ko-en ./quickmt-ko-en
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
Finally use the model in python:
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from quickmt import Translator
|
| 67 |
+
|
| 68 |
+
# Auto-detects GPU, set to "cpu" to force CPU inference
|
| 69 |
+
t = Translator("./quickmt-ko-en/", device="auto")
|
| 70 |
+
|
| 71 |
+
# Translate - set beam size to 5 for higher quality (but slower speed)
|
| 72 |
+
sample_text = '노바스코샤주 핼리팩스의 댈하우지대학교 의과 교수이자 캐나다 당뇨 협회 임상과학부 의장인 Ehud Ur 박사는 이 연구가 아직 초기 단계라고 경고했습니다.'
|
| 73 |
+
t(sample_text, beam_size=5)
|
| 74 |
+
|
| 75 |
+
> 'Dr. Ehud Ur, a medical professor at Dalhousie University in Halifax, Nova Scotia and chair of the Canadian Diabetes Association Clinical Sciences Department, warned that the study is still in its early stages.'
|
| 76 |
+
|
| 77 |
+
# Get alternative translations by sampling
|
| 78 |
+
# You can pass any cTranslate2 `translate_batch` arguments
|
| 79 |
+
t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
|
| 80 |
+
|
| 81 |
+
> 'Dr. Ehud Ur, professor of medicine and professor of medicine from the Dalhowes Institute and chair of the Canadian Diabetes Association Clinical Science Department in Halifax, Nova Scotia, warned the study is still an early step forward.'
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
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`.
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
## Metrics
|
| 88 |
+
|
| 89 |
+
`bleu` and `chrf2` are calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores) ("kor_Hang"->"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 (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).
|
| 90 |
+
|
| 91 |
+
| | bleu | chrf2 | comet22 | Time (s) |
|
| 92 |
+
|:---------------------------------|-------:|--------:|----------:|-----------:|
|
| 93 |
+
| quickmt/quickmt-ko-en | 27.03 | 56.25 | 86.11 | 1.05 |
|
| 94 |
+
| Helsink-NLP/opus-mt-ko-en | 20.78 | 50.39 | 83.06 | 3.62 |
|
| 95 |
+
| facebook/nllb-200-distilled-600M | 26.53 | 55.04 | 85.83 | 21.28 |
|
| 96 |
+
| facebook/nllb-200-distilled-1.3B | 29.61 | 57.58 | 87.24 | 37.42 |
|
| 97 |
+
| facebook/m2m100_418M | 20.75 | 50.65 | 82.07 | 18.21 |
|
| 98 |
+
| facebook/m2m100_1.2B | 24.59 | 54.17 | 85.15 | 34.82 |
|
| 99 |
+
|
| 100 |
+
`quickmt-ko-en` is the fastest and is higher quality than `opus-mt-ko-en`, `m2m100_418m`, `m2m100_1.2B` and `nllb-200-distilled-600M` but lower quality than `nllb-200-distilled-1.3B`.
|
README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- ko
|
| 5 |
+
tags:
|
| 6 |
+
- translation
|
| 7 |
+
license: cc-by-4.0
|
| 8 |
+
datasets:
|
| 9 |
+
- quickmt/quickmt-train.ko-en
|
| 10 |
+
model-index:
|
| 11 |
+
- name: quickmt-ko-en
|
| 12 |
+
results:
|
| 13 |
+
- task:
|
| 14 |
+
name: Translation kor-eng
|
| 15 |
+
type: translation
|
| 16 |
+
args: kor-eng
|
| 17 |
+
dataset:
|
| 18 |
+
name: flores101-devtest
|
| 19 |
+
type: flores_101
|
| 20 |
+
args: kor_Hang eng_Latn devtest
|
| 21 |
+
metrics:
|
| 22 |
+
- name: CHRF
|
| 23 |
+
type: chrf
|
| 24 |
+
value: 56.25
|
| 25 |
+
- name: BLEU
|
| 26 |
+
type: bleu
|
| 27 |
+
value: 27.03
|
| 28 |
+
- name: COMET
|
| 29 |
+
type: comet
|
| 30 |
+
value: 86.11
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# `quickmt-ko-en` Neural Machine Translation Model
|
| 35 |
+
|
| 36 |
+
`quickmt-ko-en` is a reasonably fast and reasonably accurate neural machine translation model for translation from `ko` 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 |
+
* 20k sentencepiece vocabularies
|
| 44 |
+
* Exported for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format
|
| 45 |
+
* Training data: https://huggingface.co/datasets/quickmt/quickmt-train.ko-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 |
+
|
| 50 |
+
## Usage with `quickmt`
|
| 51 |
+
|
| 52 |
+
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
| 53 |
+
|
| 54 |
+
Next, install the `quickmt` python library and download the model:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
git clone https://github.com/quickmt/quickmt.git
|
| 58 |
+
pip install ./quickmt/
|
| 59 |
+
|
| 60 |
+
quickmt-model-download quickmt/quickmt-ko-en ./quickmt-ko-en
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
Finally use the model in python:
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from quickmt import Translator
|
| 67 |
+
|
| 68 |
+
# Auto-detects GPU, set to "cpu" to force CPU inference
|
| 69 |
+
t = Translator("./quickmt-ko-en/", device="auto")
|
| 70 |
+
|
| 71 |
+
# Translate - set beam size to 5 for higher quality (but slower speed)
|
| 72 |
+
sample_text = '노바스코샤주 핼리팩스의 댈하우지대학교 의과 교수이자 캐나다 당뇨 협회 임상과학부 의장인 Ehud Ur 박사는 이 연구가 아직 초기 단계라고 경고했습니다.'
|
| 73 |
+
t(sample_text, beam_size=5)
|
| 74 |
+
|
| 75 |
+
> 'Dr. Ehud Ur, a medical professor at Dalhousie University in Halifax, Nova Scotia and chair of the Canadian Diabetes Association Clinical Sciences Department, warned that the study is still in its early stages.'
|
| 76 |
+
|
| 77 |
+
# Get alternative translations by sampling
|
| 78 |
+
# You can pass any cTranslate2 `translate_batch` arguments
|
| 79 |
+
t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
|
| 80 |
+
|
| 81 |
+
> 'Dr. Ehud Ur, professor of medicine and professor of medicine from the Dalhowes Institute and chair of the Canadian Diabetes Association Clinical Science Department in Halifax, Nova Scotia, warned the study is still an early step forward.'
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
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`.
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
## Metrics
|
| 88 |
+
|
| 89 |
+
`bleu` and `chrf2` are calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores) ("kor_Hang"->"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 (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).
|
| 90 |
+
|
| 91 |
+
| | bleu | chrf2 | comet22 | Time (s) |
|
| 92 |
+
|:---------------------------------|-------:|--------:|----------:|-----------:|
|
| 93 |
+
| quickmt/quickmt-ko-en | 27.03 | 56.25 | 86.11 | 1.05 |
|
| 94 |
+
| Helsink-NLP/opus-mt-ko-en | 20.78 | 50.39 | 83.06 | 3.62 |
|
| 95 |
+
| facebook/nllb-200-distilled-600M | 26.53 | 55.04 | 85.83 | 21.28 |
|
| 96 |
+
| facebook/nllb-200-distilled-1.3B | 29.61 | 57.58 | 87.24 | 37.42 |
|
| 97 |
+
| facebook/m2m100_418M | 20.75 | 50.65 | 82.07 | 18.21 |
|
| 98 |
+
| facebook/m2m100_1.2B | 24.59 | 54.17 | 85.15 | 34.82 |
|
| 99 |
+
|
| 100 |
+
`quickmt-ko-en` is the fastest and is higher quality than `opus-mt-ko-en`, `m2m100_418m`, `m2m100_1.2B` and `nllb-200-distilled-600M` but lower quality than `nllb-200-distilled-1.3B`.
|
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,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## IO
|
| 2 |
+
save_data: ko-en/data_spm
|
| 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: ko-en/src.eole.vocab
|
| 12 |
+
tgt_vocab: ko-en/tgt.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.ko-en/ko
|
| 22 |
+
#path_tgt: hf://quickmt/quickmt-train.ko-en/en
|
| 23 |
+
#path_sco: hf://quickmt/quickmt-train.ko-en/sco
|
| 24 |
+
path_src: ko-en/train.cleaned.src
|
| 25 |
+
path_tgt: ko-en/train.cleaned.tgt
|
| 26 |
+
valid:
|
| 27 |
+
path_src: ko-en/dev.src
|
| 28 |
+
path_tgt: ko-en/dev.tgt
|
| 29 |
+
|
| 30 |
+
transforms: [sentencepiece, filtertoolong]
|
| 31 |
+
transforms_configs:
|
| 32 |
+
sentencepiece:
|
| 33 |
+
src_subword_model: "ko-en/src.spm.model"
|
| 34 |
+
tgt_subword_model: "ko-en/tgt.spm.model"
|
| 35 |
+
filtertoolong:
|
| 36 |
+
src_seq_length: 256
|
| 37 |
+
tgt_seq_length: 256
|
| 38 |
+
|
| 39 |
+
training:
|
| 40 |
+
# Run configuration
|
| 41 |
+
model_path: ko-en/model
|
| 42 |
+
#train_from: ko-en/model
|
| 43 |
+
keep_checkpoint: 4
|
| 44 |
+
save_checkpoint_steps: 500
|
| 45 |
+
train_steps: 100000
|
| 46 |
+
valid_steps: 500
|
| 47 |
+
|
| 48 |
+
# Train on a single GPU
|
| 49 |
+
world_size: 1
|
| 50 |
+
gpu_ranks: [0]
|
| 51 |
+
|
| 52 |
+
# Batching
|
| 53 |
+
batch_type: "tokens"
|
| 54 |
+
batch_size: 8192
|
| 55 |
+
valid_batch_size: 8192
|
| 56 |
+
batch_size_multiple: 8
|
| 57 |
+
accum_count: [16]
|
| 58 |
+
accum_steps: [0]
|
| 59 |
+
|
| 60 |
+
# Optimizer & Compute
|
| 61 |
+
compute_dtype: "bf16"
|
| 62 |
+
optim: "pagedadamw8bit"
|
| 63 |
+
#optim: "adamw"
|
| 64 |
+
learning_rate: 2.0
|
| 65 |
+
warmup_steps: 10000
|
| 66 |
+
decay_method: "noam"
|
| 67 |
+
adam_beta2: 0.998
|
| 68 |
+
|
| 69 |
+
# Data loading
|
| 70 |
+
bucket_size: 128000
|
| 71 |
+
num_workers: 4
|
| 72 |
+
prefetch_factor: 100
|
| 73 |
+
|
| 74 |
+
# Hyperparams
|
| 75 |
+
dropout_steps: [0]
|
| 76 |
+
dropout: [0.1]
|
| 77 |
+
attention_dropout: [0.1]
|
| 78 |
+
max_grad_norm: 2
|
| 79 |
+
label_smoothing: 0.1
|
| 80 |
+
average_decay: 0.0001
|
| 81 |
+
param_init_method: xavier_uniform
|
| 82 |
+
normalization: "tokens"
|
| 83 |
+
|
| 84 |
+
model:
|
| 85 |
+
architecture: "transformer"
|
| 86 |
+
layer_norm: standard
|
| 87 |
+
share_embeddings: false
|
| 88 |
+
share_decoder_embeddings: true
|
| 89 |
+
add_ffnbias: true
|
| 90 |
+
mlp_activation_fn: gelu
|
| 91 |
+
add_estimator: false
|
| 92 |
+
add_qkvbias: false
|
| 93 |
+
norm_eps: 1e-6
|
| 94 |
+
hidden_size: 1024
|
| 95 |
+
encoder:
|
| 96 |
+
layers: 8
|
| 97 |
+
decoder:
|
| 98 |
+
layers: 2
|
| 99 |
+
heads: 8
|
| 100 |
+
transformer_ff: 4096
|
| 101 |
+
embeddings:
|
| 102 |
+
word_vec_size: 1024
|
| 103 |
+
position_encoding_type: "SinusoidalInterleaved"
|
| 104 |
+
|
| 105 |
+
|
eole-model/config.json
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transforms": [
|
| 3 |
+
"sentencepiece",
|
| 4 |
+
"filtertoolong"
|
| 5 |
+
],
|
| 6 |
+
"tgt_vocab_size": 20000,
|
| 7 |
+
"tensorboard": true,
|
| 8 |
+
"valid_metrics": [
|
| 9 |
+
"BLEU"
|
| 10 |
+
],
|
| 11 |
+
"tgt_vocab": "ko-en/tgt.eole.vocab",
|
| 12 |
+
"seed": 1234,
|
| 13 |
+
"tensorboard_log_dir": "tensorboard",
|
| 14 |
+
"tensorboard_log_dir_dated": "tensorboard/Feb-23_19-26-48",
|
| 15 |
+
"save_data": "ko-en/data_spm",
|
| 16 |
+
"vocab_size_multiple": 8,
|
| 17 |
+
"n_sample": 0,
|
| 18 |
+
"overwrite": true,
|
| 19 |
+
"src_vocab": "ko-en/src.eole.vocab",
|
| 20 |
+
"share_vocab": false,
|
| 21 |
+
"src_vocab_size": 20000,
|
| 22 |
+
"report_every": 100,
|
| 23 |
+
"training": {
|
| 24 |
+
"model_path": "ko-en/model",
|
| 25 |
+
"normalization": "tokens",
|
| 26 |
+
"accum_steps": [
|
| 27 |
+
0
|
| 28 |
+
],
|
| 29 |
+
"prefetch_factor": 100,
|
| 30 |
+
"keep_checkpoint": 4,
|
| 31 |
+
"bucket_size": 128000,
|
| 32 |
+
"valid_steps": 500,
|
| 33 |
+
"valid_batch_size": 8192,
|
| 34 |
+
"save_checkpoint_steps": 500,
|
| 35 |
+
"param_init_method": "xavier_uniform",
|
| 36 |
+
"optim": "pagedadamw8bit",
|
| 37 |
+
"num_workers": 0,
|
| 38 |
+
"batch_size": 8192,
|
| 39 |
+
"attention_dropout": [
|
| 40 |
+
0.1
|
| 41 |
+
],
|
| 42 |
+
"train_steps": 100000,
|
| 43 |
+
"average_decay": 0.0001,
|
| 44 |
+
"adam_beta2": 0.998,
|
| 45 |
+
"accum_count": [
|
| 46 |
+
16
|
| 47 |
+
],
|
| 48 |
+
"compute_dtype": "torch.bfloat16",
|
| 49 |
+
"decay_method": "noam",
|
| 50 |
+
"dropout": [
|
| 51 |
+
0.1
|
| 52 |
+
],
|
| 53 |
+
"learning_rate": 2.0,
|
| 54 |
+
"batch_size_multiple": 8,
|
| 55 |
+
"gpu_ranks": [
|
| 56 |
+
0
|
| 57 |
+
],
|
| 58 |
+
"dropout_steps": [
|
| 59 |
+
0
|
| 60 |
+
],
|
| 61 |
+
"batch_type": "tokens",
|
| 62 |
+
"world_size": 1,
|
| 63 |
+
"label_smoothing": 0.1,
|
| 64 |
+
"max_grad_norm": 2.0,
|
| 65 |
+
"warmup_steps": 10000
|
| 66 |
+
},
|
| 67 |
+
"data": {
|
| 68 |
+
"corpus_1": {
|
| 69 |
+
"transforms": [
|
| 70 |
+
"sentencepiece",
|
| 71 |
+
"filtertoolong"
|
| 72 |
+
],
|
| 73 |
+
"path_align": null,
|
| 74 |
+
"path_src": "ko-en/train.cleaned.src",
|
| 75 |
+
"path_tgt": "ko-en/train.cleaned.tgt"
|
| 76 |
+
},
|
| 77 |
+
"valid": {
|
| 78 |
+
"transforms": [
|
| 79 |
+
"sentencepiece",
|
| 80 |
+
"filtertoolong"
|
| 81 |
+
],
|
| 82 |
+
"path_align": null,
|
| 83 |
+
"path_src": "ko-en/dev.src",
|
| 84 |
+
"path_tgt": "ko-en/dev.tgt"
|
| 85 |
+
}
|
| 86 |
+
},
|
| 87 |
+
"transforms_configs": {
|
| 88 |
+
"filtertoolong": {
|
| 89 |
+
"src_seq_length": 256,
|
| 90 |
+
"tgt_seq_length": 256
|
| 91 |
+
},
|
| 92 |
+
"sentencepiece": {
|
| 93 |
+
"src_subword_model": "${MODEL_PATH}/src.spm.model",
|
| 94 |
+
"tgt_subword_model": "${MODEL_PATH}/tgt.spm.model"
|
| 95 |
+
}
|
| 96 |
+
},
|
| 97 |
+
"model": {
|
| 98 |
+
"share_decoder_embeddings": true,
|
| 99 |
+
"heads": 8,
|
| 100 |
+
"layer_norm": "standard",
|
| 101 |
+
"add_ffnbias": true,
|
| 102 |
+
"share_embeddings": false,
|
| 103 |
+
"mlp_activation_fn": "gelu",
|
| 104 |
+
"norm_eps": 1e-06,
|
| 105 |
+
"transformer_ff": 4096,
|
| 106 |
+
"architecture": "transformer",
|
| 107 |
+
"hidden_size": 1024,
|
| 108 |
+
"add_estimator": false,
|
| 109 |
+
"add_qkvbias": false,
|
| 110 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
| 111 |
+
"embeddings": {
|
| 112 |
+
"word_vec_size": 1024,
|
| 113 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
| 114 |
+
"src_word_vec_size": 1024,
|
| 115 |
+
"tgt_word_vec_size": 1024
|
| 116 |
+
},
|
| 117 |
+
"encoder": {
|
| 118 |
+
"transformer_ff": 4096,
|
| 119 |
+
"layers": 8,
|
| 120 |
+
"src_word_vec_size": 1024,
|
| 121 |
+
"heads": 8,
|
| 122 |
+
"layer_norm": "standard",
|
| 123 |
+
"add_ffnbias": true,
|
| 124 |
+
"hidden_size": 1024,
|
| 125 |
+
"n_positions": null,
|
| 126 |
+
"rope_config": null,
|
| 127 |
+
"mlp_activation_fn": "gelu",
|
| 128 |
+
"encoder_type": "transformer",
|
| 129 |
+
"add_qkvbias": false,
|
| 130 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
| 131 |
+
"norm_eps": 1e-06
|
| 132 |
+
},
|
| 133 |
+
"decoder": {
|
| 134 |
+
"transformer_ff": 4096,
|
| 135 |
+
"decoder_type": "transformer",
|
| 136 |
+
"layers": 2,
|
| 137 |
+
"heads": 8,
|
| 138 |
+
"layer_norm": "standard",
|
| 139 |
+
"add_ffnbias": true,
|
| 140 |
+
"tgt_word_vec_size": 1024,
|
| 141 |
+
"hidden_size": 1024,
|
| 142 |
+
"n_positions": null,
|
| 143 |
+
"rope_config": null,
|
| 144 |
+
"mlp_activation_fn": "gelu",
|
| 145 |
+
"add_qkvbias": false,
|
| 146 |
+
"position_encoding_type": "SinusoidalInterleaved",
|
| 147 |
+
"norm_eps": 1e-06
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
}
|
eole-model/model.00.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:141af472932c72e02495550fcf6abea9356c52293772bc42b70441103fd09dc3
|
| 3 |
+
size 721690008
|
eole-model/src.spm.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:70eb68076fe5c8ae7d8b7370aee0a8e713d3dd280d0359a4cfae3890313502dd
|
| 3 |
+
size 570981
|
eole-model/tgt.spm.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec0fe572b92a529c3fcd8d411f39667ae3cb83ad1a4e41c75f4ad48ea99f5925
|
| 3 |
+
size 583195
|
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:55376acbd84170d15cba374cb42db4d318f3795ea1b20cfb808fd88bb5bdc2b0
|
| 3 |
+
size 360796810
|
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:70eb68076fe5c8ae7d8b7370aee0a8e713d3dd280d0359a4cfae3890313502dd
|
| 3 |
+
size 570981
|
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:ec0fe572b92a529c3fcd8d411f39667ae3cb83ad1a4e41c75f4ad48ea99f5925
|
| 3 |
+
size 583195
|