Upload 6 files
Browse files- README.md +116 -36
- config.json +28 -0
- generation_config.json +7 -0
- gitattributes.txt +9 -0
- spiece.model +3 -0
- tokenizer_config.json +10 -0
README.md
CHANGED
@@ -1,50 +1,130 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
- fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
---
|
6 |
|
7 |
-
|
8 |
|
9 |
-
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
T5Tokenizer,
|
16 |
-
MT5ForConditionalGeneration,
|
17 |
-
Text2TextGenerationPipeline,
|
18 |
-
)
|
19 |
|
|
|
20 |
|
21 |
-
|
22 |
-
pipe = Text2TextGenerationPipeline(
|
23 |
-
model=MT5ForConditionalGeneration.from_pretrained(path),
|
24 |
-
tokenizer=T5Tokenizer.from_pretrained(path),
|
25 |
-
)
|
26 |
|
|
|
27 |
|
28 |
-
sentence = "ویراویراست یک نرم افزار ویرایش متن ساختاری و معنایی زبان فارسی است چیزی شبیه به گرامرلی در زبان انگلیسی"
|
29 |
-
|
30 |
-
#res = pipe(sentence, max_length=100, num_beams=4)
|
31 |
-
|
32 |
-
res = pipe(sentence, max_length=100)
|
33 |
-
|
34 |
-
print(res[0]['generated_text'])
|
35 |
-
|
36 |
-
|
37 |
-
-----------------------
|
38 |
-
n_epochs = 4
|
39 |
-
|
40 |
-
train_batch_size = 8
|
41 |
-
|
42 |
-
eval_batch_size = 4
|
43 |
-
|
44 |
-
lr = 5e-4
|
45 |
-
|
46 |
-
Training_loss=0.00550
|
47 |
-
|
48 |
-
Validation_loss=0.052046
|
49 |
|
|
|
50 |
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- multilingual
|
4 |
+
- af
|
5 |
+
- am
|
6 |
+
- ar
|
7 |
+
- az
|
8 |
+
- be
|
9 |
+
- bg
|
10 |
+
- bn
|
11 |
+
- ca
|
12 |
+
- ceb
|
13 |
+
- co
|
14 |
+
- cs
|
15 |
+
- cy
|
16 |
+
- da
|
17 |
+
- de
|
18 |
+
- el
|
19 |
+
- en
|
20 |
+
- eo
|
21 |
+
- es
|
22 |
+
- et
|
23 |
+
- eu
|
24 |
- fa
|
25 |
+
- fi
|
26 |
+
- fil
|
27 |
+
- fr
|
28 |
+
- fy
|
29 |
+
- ga
|
30 |
+
- gd
|
31 |
+
- gl
|
32 |
+
- gu
|
33 |
+
- ha
|
34 |
+
- haw
|
35 |
+
- hi
|
36 |
+
- hmn
|
37 |
+
- ht
|
38 |
+
- hu
|
39 |
+
- hy
|
40 |
+
- ig
|
41 |
+
- is
|
42 |
+
- it
|
43 |
+
- iw
|
44 |
+
- ja
|
45 |
+
- jv
|
46 |
+
- ka
|
47 |
+
- kk
|
48 |
+
- km
|
49 |
+
- kn
|
50 |
+
- ko
|
51 |
+
- ku
|
52 |
+
- ky
|
53 |
+
- la
|
54 |
+
- lb
|
55 |
+
- lo
|
56 |
+
- lt
|
57 |
+
- lv
|
58 |
+
- mg
|
59 |
+
- mi
|
60 |
+
- mk
|
61 |
+
- ml
|
62 |
+
- mn
|
63 |
+
- mr
|
64 |
+
- ms
|
65 |
+
- mt
|
66 |
+
- my
|
67 |
+
- ne
|
68 |
+
- nl
|
69 |
+
- no
|
70 |
+
- ny
|
71 |
+
- pa
|
72 |
+
- pl
|
73 |
+
- ps
|
74 |
+
- pt
|
75 |
+
- ro
|
76 |
+
- ru
|
77 |
+
- sd
|
78 |
+
- si
|
79 |
+
- sk
|
80 |
+
- sl
|
81 |
+
- sm
|
82 |
+
- sn
|
83 |
+
- so
|
84 |
+
- sq
|
85 |
+
- sr
|
86 |
+
- st
|
87 |
+
- su
|
88 |
+
- sv
|
89 |
+
- sw
|
90 |
+
- ta
|
91 |
+
- te
|
92 |
+
- tg
|
93 |
+
- th
|
94 |
+
- tr
|
95 |
+
- uk
|
96 |
+
- und
|
97 |
+
- ur
|
98 |
+
- uz
|
99 |
+
- vi
|
100 |
+
- xh
|
101 |
+
- yi
|
102 |
+
- yo
|
103 |
+
- zh
|
104 |
+
- zu
|
105 |
+
datasets:
|
106 |
+
- mc4
|
107 |
+
|
108 |
+
license: apache-2.0
|
109 |
---
|
110 |
|
111 |
+
[Google's mT5](https://github.com/google-research/multilingual-t5)
|
112 |
|
113 |
+
mT5 is pretrained on the [mC4](https://www.tensorflow.org/datasets/catalog/c4#c4multilingual) corpus, covering 101 languages:
|
114 |
|
115 |
+
Afrikaans, Albanian, Amharic, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bulgarian, Burmese, Catalan, Cebuano, Chichewa, Chinese, Corsican, Czech, Danish, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hmong, Hungarian, Icelandic, Igbo, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Korean, Kurdish, Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Nepali, Norwegian, Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Samoan, Scottish Gaelic, Serbian, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Sotho, Spanish, Sundanese, Swahili, Swedish, Tajik, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Uzbek, Vietnamese, Welsh, West Frisian, Xhosa, Yiddish, Yoruba, Zulu.
|
116 |
|
117 |
+
**Note**: mT5 was only pre-trained on mC4 excluding any supervised training. Therefore, this model has to be fine-tuned before it is useable on a downstream task.
|
118 |
|
119 |
+
Pretraining Dataset: [mC4](https://www.tensorflow.org/datasets/catalog/c4#c4multilingual)
|
|
|
|
|
|
|
|
|
120 |
|
121 |
+
Other Community Checkpoints: [here](https://huggingface.co/models?search=mt5)
|
122 |
|
123 |
+
Paper: [mT5: A massively multilingual pre-trained text-to-text transformer](https://arxiv.org/abs/2010.11934)
|
|
|
|
|
|
|
|
|
124 |
|
125 |
+
Authors: *Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, Colin Raffel*
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
+
## Abstract
|
129 |
|
130 |
+
The recent "Text-to-Text Transfer Transformer" (T5) leveraged a unified text-to-text format and scale to attain state-of-the-art results on a wide variety of English-language NLP tasks. In this paper, we introduce mT5, a multilingual variant of T5 that was pre-trained on a new Common Crawl-based dataset covering 101 languages. We describe the design and modified training of mT5 and demonstrate its state-of-the-art performance on many multilingual benchmarks. All of the code and model checkpoints used in this work are publicly available.
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/home/patrick/hugging_face/t5/mt5-base",
|
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 |
+
"transformers_version": "4.10.0.dev0",
|
26 |
+
"use_cache": true,
|
27 |
+
"vocab_size": 250112
|
28 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"decoder_start_token_id": 0,
|
4 |
+
"eos_token_id": 1,
|
5 |
+
"pad_token_id": 0,
|
6 |
+
"transformers_version": "4.27.0.dev0"
|
7 |
+
}
|
gitattributes.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
spiece.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ef78f86560d809067d12bac6c09f19a462cb3af3f54d2b8acbba26e1433125d6
|
3 |
+
size 4309802
|
tokenizer_config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{"eos_token": "</s>",
|
2 |
+
"unk_token": "<unk>",
|
3 |
+
"pad_token": "<pad>",
|
4 |
+
"extra_ids": 0,
|
5 |
+
"additional_special_tokens": null,
|
6 |
+
"special_tokens_map_file": "/home/patrick/.cache/torch/transformers/685ac0ca8568ec593a48b61b0a3c272beee9bc194a3c7241d15dcadb5f875e53.f76030f3ec1b96a8199b2593390c610e76ca8028ef3d24680000619ffb646276",
|
7 |
+
"model_max_length": 512,
|
8 |
+
"tokenizer_file": null,
|
9 |
+
"tokenizer_class": "T5Tokenizer",
|
10 |
+
"name_or_path": "google/mt5-small"}
|