File size: 1,789 Bytes
4557487
 
 
 
 
 
 
 
 
437a8ab
4557487
 
9258b0c
 
437a8ab
4557487
4f33d95
4557487
 
 
 
 
 
 
 
 
4f33d95
9258b0c
4f33d95
9258b0c
4f33d95
 
4557487
 
 
 
 
 
 
4f33d95
4557487
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from __gin__ import dynamic_registration
import tasks

import __main__ as train_script
from t5.data import mixtures
from t5x import models
from t5x import partitioning
from t5x import utils

include "t5x/examples/t5/mt5/large.gin"
include "t5x/configs/runs/finetune.gin"

MIXTURE_OR_TASK_NAME = "angry_tweets"
TASK_FEATURE_LENGTHS = {"inputs": 512, "targets": 8}
TRAIN_STEPS = 1_005_000  # 1000000 pre-trained steps + 10000 fine-tuning steps.
USE_CACHED_TASKS = False
DROPOUT_RATE = 0.1
RANDOM_SEED = 0

# Pere: Only necessary if we load a t5 model. We can start with an t5x model here
# `LOSS_NORMALIZING_FACTOR`: When fine-tuning a model that was pre-trained
# using Mesh Tensorflow (e.g. the public T5 / mT5 / ByT5 models), this should be
# set to `pretraining batch_size` * `target_token_length`. For T5 and T5.1.1:
# `2048 * 114`. For mT5: `1024 * 229`. For ByT5: `1024 * 189`.
#LOSS_NORMALIZING_FACTOR = 234496

#INITIAL_CHECKPOINT_PATH = "gs://t5-data/pretrained_models/t5x/mt5_base/checkpoint_1000000"
#INITIAL_CHECKPOINT_PATH = "gs://t5-data/pretrained_models/t5x/mt5_large/checkpoint_1000000"
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/pk_nb_t5x_base_run1/checkpoint_1100000"
INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/norwegian_NCC_plus_English_pluss200k_scandinavian_t5x_large/checkpoint_1700000"



#train_script.train:
#  eval_period = 500
#  partitioner = @partitioning.ModelBasedPjitPartitioner()
# partitioning.PjitPartitioner.num_partitions = 1

# `num_decodes` is equivalent to a beam size in a beam search decoding.
# models.EncoderDecoderModel.predict_batch_with_aux.num_decodes = 1

#mesh_transformer.learning_rate_schedules.constant_learning_rate.learning_rate = 0.0005
#run.learning_rate_schedule = @learning_rate_schedules.constant_learning_rate