File size: 986 Bytes
4f33d95
 
 
 
 
 
 
 
 
 
 
e01a248
81de315
4f33d95
57a778a
4f33d95
 
 
 
 
 
 
 
 
 
dd620f6
e01a248
 
4f33d95
 
 
 
 
 
 
 
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
from __gin__ import dynamic_registration
import tasks

import __main__ as eval_script
from t5.data import mixtures
from t5x import partitioning
from t5x import utils

include "t5x/examples/t5/mt5/base.gin"

CHECKPOINT_PATH = %gin.REQUIRED  # passed via commandline
SPLIT = %gin.REQUIRED  # passed via commandline
EVAL_OUTPUT_DIR = "./log/"
DROPOUT_RATE = 0.0  # unused boilerplate
MIXTURE_OR_TASK_NAME = "sentiment"

eval_script.evaluate:
  model = %MODEL  # imported from separate gin file
  dataset_cfg = @utils.DatasetConfig()
  restore_checkpoint_cfg = @utils.RestoreCheckpointConfig()
  output_dir = %EVAL_OUTPUT_DIR
  partitioner = @partitioning.PjitPartitioner()

utils.DatasetConfig:
  mixture_or_task_name = %MIXTURE_OR_TASK_NAME
  task_feature_lengths = {"inputs": 512, "targets": 2}
  split = %SPLIT
  batch_size = 16
  shuffle = False
  seed = 42

partitioning.PjitPartitioner.num_partitions = 2

utils.RestoreCheckpointConfig:
  path = %CHECKPOINT_PATH
  mode = 'specific'