Commit from model create scripts
Browse files- .gitattributes +2 -8
- config.gin +178 -0
- config.json +29 -0
- flax_model.msgpack +3 -0
- model-info.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- spiece.model +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +1 -0
- train/events.out.tfevents.1651404832.t1v-n-e0ac4436-w-0.468860.0.v2 +3 -0
- training_eval/translate/events.out.tfevents.1651404833.t1v-n-e0ac4436-w-0.468860.1.v2 +3 -0
.gitattributes
CHANGED
@@ -2,27 +2,20 @@
|
|
2 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
*.tflite filter=lfs diff=lfs merge=lfs -text
|
@@ -30,5 +23,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
30 |
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
2 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
|
|
5 |
*.ftz filter=lfs diff=lfs merge=lfs -text
|
6 |
*.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
*.h5 filter=lfs diff=lfs merge=lfs -text
|
8 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
9 |
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
|
|
10 |
*.model filter=lfs diff=lfs merge=lfs -text
|
11 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
12 |
*.onnx filter=lfs diff=lfs merge=lfs -text
|
13 |
*.ot filter=lfs diff=lfs merge=lfs -text
|
14 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
15 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
16 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
17 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
18 |
*.rar filter=lfs diff=lfs merge=lfs -text
|
|
|
19 |
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
20 |
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
21 |
*.tflite filter=lfs diff=lfs merge=lfs -text
|
|
|
23 |
*.wasm filter=lfs diff=lfs merge=lfs -text
|
24 |
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
config.gin
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __gin__ import dynamic_registration
|
2 |
+
import __main__ as train_script
|
3 |
+
import seqio
|
4 |
+
from t5.data import mixtures
|
5 |
+
from t5x import adafactor
|
6 |
+
from t5x.examples.t5 import network
|
7 |
+
from t5x import gin_utils
|
8 |
+
from t5x import models
|
9 |
+
from t5x import partitioning
|
10 |
+
from t5x import trainer
|
11 |
+
from t5x import utils
|
12 |
+
import tasks
|
13 |
+
|
14 |
+
# Macros:
|
15 |
+
# ==============================================================================
|
16 |
+
BATCH_SIZE = 128
|
17 |
+
DROPOUT_RATE = 0.1
|
18 |
+
EVAL_STEPS = 20
|
19 |
+
EVALUATOR_NUM_EXAMPLES = None
|
20 |
+
EVALUATOR_USE_MEMORY_CACHE = True
|
21 |
+
INITIAL_CHECKPOINT_PATH = \
|
22 |
+
'gs://nb-t5x-us-central2/norwegian_NCC_plus_English_pluss200k_balanced_bokmaal_nynorsk_t5x_small/checkpoint_1700000'
|
23 |
+
JSON_WRITE_N_RESULTS = None
|
24 |
+
LABEL_SMOOTHING = 0.0
|
25 |
+
LOSS_NORMALIZING_FACTOR = None
|
26 |
+
MIXTURE_OR_TASK_MODULE = None
|
27 |
+
MIXTURE_OR_TASK_NAME = 'translate'
|
28 |
+
MODEL = @models.EncoderDecoderModel()
|
29 |
+
MODEL_DIR = 'gs://nb-t5x-us-central2/finetuned/nynorsk_balanced_small_v5'
|
30 |
+
OPTIMIZER = @adafactor.Adafactor()
|
31 |
+
RANDOM_SEED = 0
|
32 |
+
TASK_FEATURE_LENGTHS = {'inputs': 512, 'targets': 512}
|
33 |
+
TRAIN_STEPS = 1705000
|
34 |
+
USE_CACHED_TASKS = False
|
35 |
+
USE_HARDWARE_RNG = False
|
36 |
+
VOCABULARY = @seqio.SentencePieceVocabulary()
|
37 |
+
Z_LOSS = 0.0001
|
38 |
+
|
39 |
+
# Parameters for adafactor.Adafactor:
|
40 |
+
# ==============================================================================
|
41 |
+
adafactor.Adafactor.decay_rate = 0.8
|
42 |
+
adafactor.Adafactor.logical_factor_rules = \
|
43 |
+
@adafactor.standard_logical_factor_rules()
|
44 |
+
adafactor.Adafactor.step_offset = 0
|
45 |
+
|
46 |
+
# Parameters for utils.CheckpointConfig:
|
47 |
+
# ==============================================================================
|
48 |
+
utils.CheckpointConfig.restore = @utils.RestoreCheckpointConfig()
|
49 |
+
utils.CheckpointConfig.save = @utils.SaveCheckpointConfig()
|
50 |
+
|
51 |
+
# Parameters for utils.create_learning_rate_scheduler:
|
52 |
+
# ==============================================================================
|
53 |
+
utils.create_learning_rate_scheduler.base_learning_rate = 0.001
|
54 |
+
utils.create_learning_rate_scheduler.factors = 'constant'
|
55 |
+
utils.create_learning_rate_scheduler.warmup_steps = 1000
|
56 |
+
|
57 |
+
# Parameters for infer_eval/utils.DatasetConfig:
|
58 |
+
# ==============================================================================
|
59 |
+
infer_eval/utils.DatasetConfig.batch_size = %BATCH_SIZE
|
60 |
+
infer_eval/utils.DatasetConfig.mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
61 |
+
infer_eval/utils.DatasetConfig.module = %MIXTURE_OR_TASK_MODULE
|
62 |
+
infer_eval/utils.DatasetConfig.pack = False
|
63 |
+
infer_eval/utils.DatasetConfig.seed = 42
|
64 |
+
infer_eval/utils.DatasetConfig.shuffle = False
|
65 |
+
infer_eval/utils.DatasetConfig.split = 'validation'
|
66 |
+
infer_eval/utils.DatasetConfig.task_feature_lengths = %TASK_FEATURE_LENGTHS
|
67 |
+
infer_eval/utils.DatasetConfig.use_cached = %USE_CACHED_TASKS
|
68 |
+
|
69 |
+
# Parameters for train/utils.DatasetConfig:
|
70 |
+
# ==============================================================================
|
71 |
+
train/utils.DatasetConfig.batch_size = %BATCH_SIZE
|
72 |
+
train/utils.DatasetConfig.mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
73 |
+
train/utils.DatasetConfig.module = %MIXTURE_OR_TASK_MODULE
|
74 |
+
train/utils.DatasetConfig.pack = True
|
75 |
+
train/utils.DatasetConfig.seed = None
|
76 |
+
train/utils.DatasetConfig.shuffle = True
|
77 |
+
train/utils.DatasetConfig.split = 'train'
|
78 |
+
train/utils.DatasetConfig.task_feature_lengths = %TASK_FEATURE_LENGTHS
|
79 |
+
train/utils.DatasetConfig.use_cached = %USE_CACHED_TASKS
|
80 |
+
|
81 |
+
# Parameters for train_eval/utils.DatasetConfig:
|
82 |
+
# ==============================================================================
|
83 |
+
train_eval/utils.DatasetConfig.batch_size = %BATCH_SIZE
|
84 |
+
train_eval/utils.DatasetConfig.mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
85 |
+
train_eval/utils.DatasetConfig.module = %MIXTURE_OR_TASK_MODULE
|
86 |
+
train_eval/utils.DatasetConfig.pack = True
|
87 |
+
train_eval/utils.DatasetConfig.seed = 42
|
88 |
+
train_eval/utils.DatasetConfig.shuffle = False
|
89 |
+
train_eval/utils.DatasetConfig.split = 'validation'
|
90 |
+
train_eval/utils.DatasetConfig.task_feature_lengths = %TASK_FEATURE_LENGTHS
|
91 |
+
train_eval/utils.DatasetConfig.use_cached = %USE_CACHED_TASKS
|
92 |
+
|
93 |
+
# Parameters for models.EncoderDecoderModel:
|
94 |
+
# ==============================================================================
|
95 |
+
models.EncoderDecoderModel.input_vocabulary = %VOCABULARY
|
96 |
+
models.EncoderDecoderModel.label_smoothing = %LABEL_SMOOTHING
|
97 |
+
models.EncoderDecoderModel.loss_normalizing_factor = %LOSS_NORMALIZING_FACTOR
|
98 |
+
models.EncoderDecoderModel.module = @network.Transformer()
|
99 |
+
models.EncoderDecoderModel.optimizer_def = %OPTIMIZER
|
100 |
+
models.EncoderDecoderModel.output_vocabulary = %VOCABULARY
|
101 |
+
models.EncoderDecoderModel.z_loss = %Z_LOSS
|
102 |
+
|
103 |
+
# Parameters for seqio.Evaluator:
|
104 |
+
# ==============================================================================
|
105 |
+
seqio.Evaluator.logger_cls = \
|
106 |
+
[@seqio.PyLoggingLogger, @seqio.TensorBoardLogger, @seqio.JSONLogger]
|
107 |
+
seqio.Evaluator.num_examples = %EVALUATOR_NUM_EXAMPLES
|
108 |
+
seqio.Evaluator.use_memory_cache = %EVALUATOR_USE_MEMORY_CACHE
|
109 |
+
|
110 |
+
# Parameters for seqio.JSONLogger:
|
111 |
+
# ==============================================================================
|
112 |
+
seqio.JSONLogger.write_n_results = %JSON_WRITE_N_RESULTS
|
113 |
+
|
114 |
+
# Parameters for partitioning.PjitPartitioner:
|
115 |
+
# ==============================================================================
|
116 |
+
partitioning.PjitPartitioner.logical_axis_rules = \
|
117 |
+
@partitioning.standard_logical_axis_rules()
|
118 |
+
partitioning.PjitPartitioner.model_parallel_submesh = None
|
119 |
+
partitioning.PjitPartitioner.num_partitions = 1
|
120 |
+
|
121 |
+
# Parameters for utils.RestoreCheckpointConfig:
|
122 |
+
# ==============================================================================
|
123 |
+
utils.RestoreCheckpointConfig.dtype = 'float32'
|
124 |
+
utils.RestoreCheckpointConfig.mode = 'specific'
|
125 |
+
utils.RestoreCheckpointConfig.path = %INITIAL_CHECKPOINT_PATH
|
126 |
+
|
127 |
+
# Parameters for utils.SaveCheckpointConfig:
|
128 |
+
# ==============================================================================
|
129 |
+
utils.SaveCheckpointConfig.dtype = 'float32'
|
130 |
+
utils.SaveCheckpointConfig.keep = None
|
131 |
+
utils.SaveCheckpointConfig.period = 1000
|
132 |
+
utils.SaveCheckpointConfig.save_dataset = False
|
133 |
+
|
134 |
+
# Parameters for seqio.SentencePieceVocabulary:
|
135 |
+
# ==============================================================================
|
136 |
+
seqio.SentencePieceVocabulary.sentencepiece_model_file = \
|
137 |
+
'gs://t5-data/vocabs/mc4.250000.100extra/sentencepiece.model'
|
138 |
+
|
139 |
+
# Parameters for network.T5Config:
|
140 |
+
# ==============================================================================
|
141 |
+
network.T5Config.dropout_rate = %DROPOUT_RATE
|
142 |
+
network.T5Config.dtype = 'bfloat16'
|
143 |
+
network.T5Config.emb_dim = 512
|
144 |
+
network.T5Config.head_dim = 64
|
145 |
+
network.T5Config.logits_via_embedding = False
|
146 |
+
network.T5Config.mlp_activations = ('gelu', 'linear')
|
147 |
+
network.T5Config.mlp_dim = 1024
|
148 |
+
network.T5Config.num_decoder_layers = 8
|
149 |
+
network.T5Config.num_encoder_layers = 8
|
150 |
+
network.T5Config.num_heads = 6
|
151 |
+
network.T5Config.vocab_size = 250112
|
152 |
+
|
153 |
+
# Parameters for train_script.train:
|
154 |
+
# ==============================================================================
|
155 |
+
train_script.train.checkpoint_cfg = @utils.CheckpointConfig()
|
156 |
+
train_script.train.eval_period = 1000
|
157 |
+
train_script.train.eval_steps = %EVAL_STEPS
|
158 |
+
train_script.train.infer_eval_dataset_cfg = @infer_eval/utils.DatasetConfig()
|
159 |
+
train_script.train.inference_evaluator_cls = @seqio.Evaluator
|
160 |
+
train_script.train.model = %MODEL
|
161 |
+
train_script.train.model_dir = %MODEL_DIR
|
162 |
+
train_script.train.partitioner = @partitioning.PjitPartitioner()
|
163 |
+
train_script.train.random_seed = %RANDOM_SEED
|
164 |
+
train_script.train.summarize_config_fn = @gin_utils.summarize_gin_config
|
165 |
+
train_script.train.total_steps = %TRAIN_STEPS
|
166 |
+
train_script.train.train_dataset_cfg = @train/utils.DatasetConfig()
|
167 |
+
train_script.train.train_eval_dataset_cfg = @train_eval/utils.DatasetConfig()
|
168 |
+
train_script.train.trainer_cls = @trainer.Trainer
|
169 |
+
train_script.train.use_hardware_rng = %USE_HARDWARE_RNG
|
170 |
+
|
171 |
+
# Parameters for trainer.Trainer:
|
172 |
+
# ==============================================================================
|
173 |
+
trainer.Trainer.learning_rate_fn = @utils.create_learning_rate_scheduler()
|
174 |
+
trainer.Trainer.num_microbatches = None
|
175 |
+
|
176 |
+
# Parameters for network.Transformer:
|
177 |
+
# ==============================================================================
|
178 |
+
network.Transformer.config = @network.T5Config()
|
config.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/home/perk/models/nynorsk_North_small",
|
3 |
+
"architectures": [
|
4 |
+
"T5ForConditionalGeneration"
|
5 |
+
],
|
6 |
+
"d_ff": 1024,
|
7 |
+
"d_kv": 64,
|
8 |
+
"d_model": 512,
|
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": "t5",
|
17 |
+
"num_decoder_layers": 8,
|
18 |
+
"num_heads": 6,
|
19 |
+
"num_layers": 8,
|
20 |
+
"pad_token_id": 0,
|
21 |
+
"relative_attention_max_distance": 128,
|
22 |
+
"relative_attention_num_buckets": 32,
|
23 |
+
"tie_word_embeddings": false,
|
24 |
+
"tokenizer_class": "T5Tokenizer",
|
25 |
+
"torch_dtype": "float32",
|
26 |
+
"transformers_version": "4.19.2",
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 250112
|
29 |
+
}
|
flax_model.msgpack
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e456b85a9413fe3f242f3124e0f3660b2649d90623a29f40cf2e550134db2e2e
|
3 |
+
size 1200715307
|
model-info.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cc52ffc1e939b85e0fd1ca650e2c09d6ad14784d999a6df26726b3aa63108f6e
|
3 |
+
size 1200768197
|
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:ef78f86560d809067d12bac6c09f19a462cb3af3f54d2b8acbba26e1433125d6
|
3 |
+
size 4309802
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:93c3578052e1605d8332eb961bc08d72e246071974e4cc54aa6991826b802aa5
|
3 |
+
size 16330369
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>", "extra_ids": 0, "additional_special_tokens": null, "special_tokens_map_file": "/home/patrick/.cache/torch/transformers/685ac0ca8568ec593a48b61b0a3c272beee9bc194a3c7241d15dcadb5f875e53.f76030f3ec1b96a8199b2593390c610e76ca8028ef3d24680000619ffb646276", "name_or_path": "/home/perk/models/nynorsk_North_small", "sp_model_kwargs": {}, "tokenizer_class": "T5Tokenizer"}
|
train/events.out.tfevents.1651404832.t1v-n-e0ac4436-w-0.468860.0.v2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a98f1bf4731be4a58d3b6eb272ce0c5bfd75212bffc403bed6f2acd96fa354c8
|
3 |
+
size 15729
|
training_eval/translate/events.out.tfevents.1651404833.t1v-n-e0ac4436-w-0.468860.1.v2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff4af259def519bde51427838c03b2c09383e90c7c0aaa3ab0802926eac762e8
|
3 |
+
size 6651
|