K024
commited on
Commit
·
226c237
1
Parent(s):
1978831
upload files
Browse files- README.md +56 -1
- config.json +29 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- spiece.model +3 -0
- tokenizer_config.json +1 -0
README.md
CHANGED
|
@@ -1,3 +1,58 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- zh
|
| 4 |
+
- ja
|
| 5 |
+
- en
|
| 6 |
+
|
| 7 |
+
tags:
|
| 8 |
+
- translation
|
| 9 |
+
|
| 10 |
+
widget:
|
| 11 |
+
- text: "ja2zh: 吾輩は猫である。名前はまだ無い。"
|
| 12 |
+
|
| 13 |
+
license: cc-by-nc-sa-4.0
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
This model is finetuned from [mt5-base](https://huggingface.co/google/mt5-base).
|
| 17 |
+
|
| 18 |
+
The model vocabulary is trimmed to ~1/3 by selecting top 85000 tokens in the traning data.
|
| 19 |
+
|
| 20 |
+
Usage:
|
| 21 |
+
```python
|
| 22 |
+
from transformers import (
|
| 23 |
+
T5Tokenizer,
|
| 24 |
+
MT5ForConditionalGeneration,
|
| 25 |
+
Text2TextGenerationPipeline,
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
path = "K024/mt5-zh-ja-en-trimmed"
|
| 29 |
+
pipe = Text2TextGenerationPipeline(
|
| 30 |
+
model=MT5ForConditionalGeneration.from_pretrained(path),
|
| 31 |
+
tokenizer=T5Tokenizer.from_pretrained(path),
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
sentence = "ja2zh: 吾輩は猫である。名前はまだ無い。"
|
| 35 |
+
res = pipe(sentence, max_length=100, num_beams=4)
|
| 36 |
+
res[0]['generated_text']
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Training data:
|
| 40 |
+
```
|
| 41 |
+
wikimedia-en-ja
|
| 42 |
+
wikimedia-en-zh
|
| 43 |
+
wikimedia-ja-zh
|
| 44 |
+
wikititles-ja-en
|
| 45 |
+
wikititles-zh-en
|
| 46 |
+
wikimatrix-ja-zh
|
| 47 |
+
news-commentary-en-ja
|
| 48 |
+
news-commentary-en-zh
|
| 49 |
+
news-commentary-ja-zh
|
| 50 |
+
ted2020-en-ja
|
| 51 |
+
ted2020-en-zh
|
| 52 |
+
ted2020-ja-zh
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
License: [![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
|
| 56 |
+
|
| 57 |
+
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
|
| 58 |
+
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
|
config.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "K024/mt5-zh-ja-en-trimmed",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"MT5ForConditionalGeneration"
|
| 5 |
+
],
|
| 6 |
+
"d_ff": 2048,
|
| 7 |
+
"d_kv": 64,
|
| 8 |
+
"d_model": 768,
|
| 9 |
+
"decoder_start_token_id": 0,
|
| 10 |
+
"dropout_rate": 0.1,
|
| 11 |
+
"eos_token_id": 1,
|
| 12 |
+
"feed_forward_proj": "gated-gelu",
|
| 13 |
+
"initializer_factor": 1.0,
|
| 14 |
+
"is_encoder_decoder": true,
|
| 15 |
+
"layer_norm_epsilon": 1e-06,
|
| 16 |
+
"model_type": "mt5",
|
| 17 |
+
"num_decoder_layers": 12,
|
| 18 |
+
"num_heads": 12,
|
| 19 |
+
"num_layers": 12,
|
| 20 |
+
"output_past": true,
|
| 21 |
+
"pad_token_id": 0,
|
| 22 |
+
"relative_attention_num_buckets": 32,
|
| 23 |
+
"tie_word_embeddings": false,
|
| 24 |
+
"tokenizer_class": "T5Tokenizer",
|
| 25 |
+
"torch_dtype": "float32",
|
| 26 |
+
"transformers_version": "4.15.0",
|
| 27 |
+
"use_cache": true,
|
| 28 |
+
"vocab_size": 85292
|
| 29 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:696549da574a103650f23fa7dc8fb2dc838c2d7e5473e85d5637350d44628b7d
|
| 3 |
+
size 1317077965
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>"}
|
spiece.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b8557a50825d59b58c004cb4dc566ff98926d864c51fd153fb32cf5c5f19643e
|
| 3 |
+
size 1511055
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>", "extra_ids": 0, "additional_special_tokens": null, "sp_model_kwargs": {}, "special_tokens_map_file": null, "tokenizer_file": null, "name_or_path": "K024/mt5-zh-ja-en-trimmed", "tokenizer_class": "T5Tokenizer"}
|