fixed size of inference
Browse files- eval_categorisation_base.gin +1 -1
- finetune_categorisation_base.gin +9 -2
- train_base.sh +2 -1
eval_categorisation_base.gin
CHANGED
@@ -23,7 +23,7 @@ eval_script.evaluate:
|
|
23 |
|
24 |
utils.DatasetConfig:
|
25 |
mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
26 |
-
task_feature_lengths =
|
27 |
split = 'validation'
|
28 |
batch_size = 32
|
29 |
shuffle = False
|
|
|
23 |
|
24 |
utils.DatasetConfig:
|
25 |
mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
26 |
+
task_feature_lengths = {"inputs": 512, "targets": 2}
|
27 |
split = 'validation'
|
28 |
batch_size = 32
|
29 |
shuffle = False
|
finetune_categorisation_base.gin
CHANGED
@@ -12,11 +12,15 @@ include "t5x/configs/runs/finetune.gin"
|
|
12 |
|
13 |
MIXTURE_OR_TASK_NAME = "categorise"
|
14 |
TASK_FEATURE_LENGTHS = {"inputs": 512, "targets": 2}
|
15 |
-
TRAIN_STEPS =
|
16 |
USE_CACHED_TASKS = False
|
17 |
DROPOUT_RATE = 0.1
|
18 |
RANDOM_SEED = 0
|
19 |
|
|
|
|
|
|
|
|
|
20 |
# Pere: Only necessary if we load a t5 model. We can start with an t5x model here
|
21 |
# `LOSS_NORMALIZING_FACTOR`: When fine-tuning a model that was pre-trained
|
22 |
# using Mesh Tensorflow (e.g. the public T5 / mT5 / ByT5 models), this should be
|
@@ -29,7 +33,10 @@ RANDOM_SEED = 0
|
|
29 |
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/norwegian_t5x_base/checkpoint_1360000"
|
30 |
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/pk_nb_t5x_base_run1_lr_1/checkpoint_1100000"
|
31 |
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/pk_nb_t5x_base_scandinavian/checkpoint_1100000"
|
32 |
-
INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/norwegian_t5x_base/checkpoint_2000000"
|
|
|
|
|
|
|
33 |
|
34 |
#train_script.train:
|
35 |
# eval_period = 500
|
|
|
12 |
|
13 |
MIXTURE_OR_TASK_NAME = "categorise"
|
14 |
TASK_FEATURE_LENGTHS = {"inputs": 512, "targets": 2}
|
15 |
+
TRAIN_STEPS = 1_510_000 # 1000000 pre-trained steps + 10000 fine-tuning steps.
|
16 |
USE_CACHED_TASKS = False
|
17 |
DROPOUT_RATE = 0.1
|
18 |
RANDOM_SEED = 0
|
19 |
|
20 |
+
#Fixing a small error
|
21 |
+
infer_eval/utils.DatasetConfig.task_feature_lengths = TASK_FEATURE_LENGTHS
|
22 |
+
|
23 |
+
|
24 |
# Pere: Only necessary if we load a t5 model. We can start with an t5x model here
|
25 |
# `LOSS_NORMALIZING_FACTOR`: When fine-tuning a model that was pre-trained
|
26 |
# using Mesh Tensorflow (e.g. the public T5 / mT5 / ByT5 models), this should be
|
|
|
33 |
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/norwegian_t5x_base/checkpoint_1360000"
|
34 |
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/pk_nb_t5x_base_run1_lr_1/checkpoint_1100000"
|
35 |
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/pk_nb_t5x_base_scandinavian/checkpoint_1100000"
|
36 |
+
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/norwegian_t5x_base/checkpoint_2000000"
|
37 |
+
INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/norwegian_NCC_plus_English_t5x_base/checkpoint_1500000"
|
38 |
+
|
39 |
+
|
40 |
|
41 |
#train_script.train:
|
42 |
# eval_period = 500
|
train_base.sh
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
PROJECT_DIR=${HOME}"/models/t5-parliament-categorisation"
|
2 |
T5X_DIR="../../t5x" # directory where the t5x is cloned.
|
3 |
-
|
|
|
4 |
export PYTHONPATH=${PROJECT_DIR}
|
5 |
|
6 |
python3 ${T5X_DIR}/t5x/train.py \
|
|
|
1 |
PROJECT_DIR=${HOME}"/models/t5-parliament-categorisation"
|
2 |
T5X_DIR="../../t5x" # directory where the t5x is cloned.
|
3 |
+
#Needs to be updated when moving to tpu-v4 it should then be in another zone
|
4 |
+
MODEL_DIR="gs://nb-t5x-us-central2/finetuned/norwegian_NCC_pluss_english_1_500_000"
|
5 |
export PYTHONPATH=${PROJECT_DIR}
|
6 |
|
7 |
python3 ${T5X_DIR}/t5x/train.py \
|