from __gin__ import dynamic_registration import tasks import seqio 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/t5_1_1/large.gin" include "t5x/configs/runs/finetune.gin" MIXTURE_OR_TASK_NAME = %gin.REQUIRED TASK_FEATURE_LENGTHS = {"inputs": 512, "targets": 64} INITIAL_CHECKPOINT_PATH = %gin.REQUIRED TRAIN_STEPS = %gin.REQUIRED # 1000000 pre-trained steps + 10000 fine-tuning steps. USE_CACHED_TASKS = False DROPOUT_RATE = 0.1 RANDOM_SEED = 0 #BATCH_SIZE = 32 #Fixing a small error infer_eval/utils.DatasetConfig: task_feature_lengths = %TASK_FEATURE_LENGTHS #Saving every 1000 steps utils.SaveCheckpointConfig: period = 1000 # 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 # Might have to ba changed based on architecture # partitioning.PjitPartitioner.num_partitions = 1 VOCABULARY = @seqio.SentencePieceVocabulary() seqio.SentencePieceVocabulary.sentencepiece_model_file = "gs://nb-t5/t5/vocabs/wikipedia/no-da-en-sv-nn-is_32000_unigram.sp.model" seqio.SentencePieceVocabulary.extra_ids = 100