a lot of small changes so theat eval seems to run fine
Browse files
eval_base.sh
CHANGED
@@ -1,11 +1,13 @@
|
|
1 |
-
PROJECT_DIR=${HOME}"/models/t5-parliament-categorisation"
|
2 |
-
#
|
3 |
-
T5X_DIR="../../t5x" # directory where the t5x is cloned.
|
4 |
CHECKPOINT_PATH="gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000"
|
5 |
-
export PYTHONPATH=${PROJECT_DIR}
|
6 |
|
7 |
python3 eval.py \
|
8 |
-
--gin_search_paths
|
9 |
--gin_file="eval_categorisation_base.gin" \
|
10 |
-
--gin.
|
11 |
-
|
|
|
|
|
|
|
|
1 |
+
#PROJECT_DIR=${HOME}"/models/t5-parliament-categorisation"
|
2 |
+
#T5X_DIR="../../t5x" # directory where the t5x is cloned.
|
|
|
3 |
CHECKPOINT_PATH="gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000"
|
4 |
+
#export PYTHONPATH=${PROJECT_DIR}
|
5 |
|
6 |
python3 eval.py \
|
7 |
+
--gin_search_paths="./" \
|
8 |
--gin_file="eval_categorisation_base.gin" \
|
9 |
+
--gin.SPLIT=\"validation\" \
|
10 |
+
--gin.CHECKPOINT_PATH=\"gs://nb-t5x-us-central2/finetuned/norwegian_NCC_pluss_english_1_500_000/checkpoint_1505000\" \
|
11 |
+
|
12 |
+
#"gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000" \
|
13 |
+
#--gin.SPLIT="validation" \
|
eval_categorisation_base.gin
CHANGED
@@ -9,8 +9,8 @@ from t5x import utils
|
|
9 |
include "t5x/examples/t5/mt5/base.gin"
|
10 |
|
11 |
CHECKPOINT_PATH = %gin.REQUIRED # passed via commandline
|
|
|
12 |
EVAL_OUTPUT_DIR = "./log/"
|
13 |
-
|
14 |
DROPOUT_RATE = 0.0 # unused boilerplate
|
15 |
MIXTURE_OR_TASK_NAME = "categorise"
|
16 |
|
@@ -24,8 +24,8 @@ eval_script.evaluate:
|
|
24 |
utils.DatasetConfig:
|
25 |
mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
26 |
task_feature_lengths = {"inputs": 512, "targets": 2}
|
27 |
-
split =
|
28 |
-
batch_size =
|
29 |
shuffle = False
|
30 |
seed = 42
|
31 |
|
|
|
9 |
include "t5x/examples/t5/mt5/base.gin"
|
10 |
|
11 |
CHECKPOINT_PATH = %gin.REQUIRED # passed via commandline
|
12 |
+
SPLIT = %gin.REQUIRED # passed via commandline
|
13 |
EVAL_OUTPUT_DIR = "./log/"
|
|
|
14 |
DROPOUT_RATE = 0.0 # unused boilerplate
|
15 |
MIXTURE_OR_TASK_NAME = "categorise"
|
16 |
|
|
|
24 |
utils.DatasetConfig:
|
25 |
mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
26 |
task_feature_lengths = {"inputs": 512, "targets": 2}
|
27 |
+
split = %SPLIT
|
28 |
+
batch_size = 16
|
29 |
shuffle = False
|
30 |
seed = 42
|
31 |
|
train_base.sh → finetune_base.sh
RENAMED
File without changes
|
finetune_categorisation_base.gin
CHANGED
@@ -21,31 +21,19 @@ RANDOM_SEED = 0
|
|
21 |
infer_eval/utils.DatasetConfig:
|
22 |
task_feature_lengths = %TASK_FEATURE_LENGTHS
|
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
|
27 |
# set to `pretraining batch_size` * `target_token_length`. For T5 and T5.1.1:
|
28 |
# `2048 * 114`. For mT5: `1024 * 229`. For ByT5: `1024 * 189`.
|
29 |
-
#LOSS_NORMALIZING_FACTOR = 234496
|
30 |
-
|
31 |
-
#INITIAL_CHECKPOINT_PATH = "gs://t5-data/pretrained_models/t5x/mt5_base/checkpoint_1000000"
|
32 |
-
#INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/pk_nb_t5x_base_run1/checkpoint_1100000"
|
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
|
43 |
-
# partitioner = @partitioning.ModelBasedPjitPartitioner()
|
44 |
# partitioning.PjitPartitioner.num_partitions = 1
|
45 |
|
46 |
-
# `num_decodes` is equivalent to a beam size in a beam search decoding.
|
47 |
-
# models.EncoderDecoderModel.predict_batch_with_aux.num_decodes = 1
|
48 |
-
|
49 |
-
#mesh_transformer.learning_rate_schedules.constant_learning_rate.learning_rate = 0.0005
|
50 |
-
#run.learning_rate_schedule = @learning_rate_schedules.constant_learning_rate
|
51 |
-
|
|
|
21 |
infer_eval/utils.DatasetConfig:
|
22 |
task_feature_lengths = %TASK_FEATURE_LENGTHS
|
23 |
|
24 |
+
#Saving every 1000 steps
|
25 |
+
utils.SaveCheckpointConfig:
|
26 |
+
period = 1000
|
27 |
+
|
28 |
+
INITIAL_CHECKPOINT_PATH = "gs://nb-t5x-us-central2/norwegian_NCC_plus_English_t5x_base/checkpoint_1500000"
|
29 |
+
|
30 |
# Pere: Only necessary if we load a t5 model. We can start with an t5x model here
|
31 |
# `LOSS_NORMALIZING_FACTOR`: When fine-tuning a model that was pre-trained
|
32 |
# using Mesh Tensorflow (e.g. the public T5 / mT5 / ByT5 models), this should be
|
33 |
# set to `pretraining batch_size` * `target_token_length`. For T5 and T5.1.1:
|
34 |
# `2048 * 114`. For mT5: `1024 * 229`. For ByT5: `1024 * 189`.
|
35 |
+
# LOSS_NORMALIZING_FACTOR = 234496
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
# Might have to ba chaned based on architecture
|
|
|
|
|
|
|
|
|
38 |
# partitioning.PjitPartitioner.num_partitions = 1
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
train_large.sh → finetune_large.sh
RENAMED
File without changes
|
log/config.gin
CHANGED
@@ -11,7 +11,8 @@ import tasks
|
|
11 |
|
12 |
# Macros:
|
13 |
# ==============================================================================
|
14 |
-
CHECKPOINT_PATH =
|
|
|
15 |
DROPOUT_RATE = 0.0
|
16 |
EVAL_OUTPUT_DIR = './log/'
|
17 |
LABEL_SMOOTHING = 0.0
|
@@ -19,6 +20,7 @@ LOSS_NORMALIZING_FACTOR = None
|
|
19 |
MIXTURE_OR_TASK_NAME = 'categorise'
|
20 |
MODEL = @models.EncoderDecoderModel()
|
21 |
OPTIMIZER = @adafactor.Adafactor()
|
|
|
22 |
VOCABULARY = @seqio.SentencePieceVocabulary()
|
23 |
Z_LOSS = 0.0001
|
24 |
|
@@ -31,11 +33,11 @@ adafactor.Adafactor.step_offset = 0
|
|
31 |
|
32 |
# Parameters for utils.DatasetConfig:
|
33 |
# ==============================================================================
|
34 |
-
utils.DatasetConfig.batch_size =
|
35 |
utils.DatasetConfig.mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
36 |
utils.DatasetConfig.seed = 42
|
37 |
utils.DatasetConfig.shuffle = False
|
38 |
-
utils.DatasetConfig.split =
|
39 |
utils.DatasetConfig.task_feature_lengths = {'inputs': 512, 'targets': 2}
|
40 |
|
41 |
# Parameters for models.EncoderDecoderModel:
|
|
|
11 |
|
12 |
# Macros:
|
13 |
# ==============================================================================
|
14 |
+
CHECKPOINT_PATH = \
|
15 |
+
'gs://nb-t5x-us-central2/finetuned/norwegian_NCC_pluss_english_1_500_000/checkpoint_1505000'
|
16 |
DROPOUT_RATE = 0.0
|
17 |
EVAL_OUTPUT_DIR = './log/'
|
18 |
LABEL_SMOOTHING = 0.0
|
|
|
20 |
MIXTURE_OR_TASK_NAME = 'categorise'
|
21 |
MODEL = @models.EncoderDecoderModel()
|
22 |
OPTIMIZER = @adafactor.Adafactor()
|
23 |
+
SPLIT = 'validation'
|
24 |
VOCABULARY = @seqio.SentencePieceVocabulary()
|
25 |
Z_LOSS = 0.0001
|
26 |
|
|
|
33 |
|
34 |
# Parameters for utils.DatasetConfig:
|
35 |
# ==============================================================================
|
36 |
+
utils.DatasetConfig.batch_size = 16
|
37 |
utils.DatasetConfig.mixture_or_task_name = %MIXTURE_OR_TASK_NAME
|
38 |
utils.DatasetConfig.seed = 42
|
39 |
utils.DatasetConfig.shuffle = False
|
40 |
+
utils.DatasetConfig.split = %SPLIT
|
41 |
utils.DatasetConfig.task_feature_lengths = {'inputs': 512, 'targets': 2}
|
42 |
|
43 |
# Parameters for models.EncoderDecoderModel:
|
log/eval_results_t1v-n-7b23714e-w-0.jsonl
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
-
{"model": "gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000", "eval_date": "
|
2 |
-
{"model": "gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000", "eval_date": "
|
3 |
-
{"model": "gs://nb-t5x/
|
4 |
-
{"model": "gs://nb-t5x/
|
5 |
-
{"model": "gs://nb-t5x/
|
6 |
-
{"model": "gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000", "eval_date": "11-04-2022 06:48:47", "split": "validation", "result": {"accuracy": 84.83333333333334}}
|
7 |
-
{"model": "gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000", "eval_date": "11-04-2022 07:01:50", "split": "validation", "feature_length": {"inputs": 512, "targets": 2}, "eval_batch_size": 32, "result": {"accuracy": 84.83333333333334, "f1_macro": 84.82911919977771}}
|
|
|
1 |
+
{"model": "gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000", "task": "categorise", "eval_date": "11-04-2022 07:28:10", "split": "validation", "feature_length": {"inputs": 512, "targets": 2}, "eval_batch_size": 16, "result": {"accuracy": 85.08333333333333, "f1_macro": 85.07959287015703}}
|
2 |
+
{"model": "gs://nb-t5x/eval_norwegian_NCC_2_000_000/checkpoint_2005000", "task": "categorise", "eval_date": "11-04-2022 07:44:00", "split": "test", "feature_length": {"inputs": 512, "targets": 2}, "eval_batch_size": 16, "result": {"accuracy": 84.41666666666666, "f1_macro": 84.40877360830586}}
|
3 |
+
{"model": "gs://nb-t5x-us-central2/finetuned/norwegian_NCC_pluss_english_1_500_000/checkpoint_1510000", "task": "categorise", "eval_date": "11-04-2022 07:49:05", "split": "validation", "feature_length": {"inputs": 512, "targets": 2}, "eval_batch_size": 16, "result": {"accuracy": 86.5, "f1_macro": 86.49816224986179}}
|
4 |
+
{"model": "gs://nb-t5x-us-central2/finetuned/norwegian_NCC_pluss_english_1_500_000/checkpoint_1510000", "task": "categorise", "eval_date": "11-04-2022 07:51:08", "split": "test", "feature_length": {"inputs": 512, "targets": 2}, "eval_batch_size": 16, "result": {"accuracy": 85.25, "f1_macro": 85.2425290303216}}
|
5 |
+
{"model": "gs://nb-t5x-us-central2/finetuned/norwegian_NCC_pluss_english_1_500_000/checkpoint_1505000", "task": "categorise", "eval_date": "11-04-2022 08:13:36", "split": "validation", "feature_length": {"inputs": 512, "targets": 2}, "eval_batch_size": 16, "result": {"accuracy": 85.25, "f1_macro": 85.24014985000407}}
|
|
|
|