forked from facebookresearch/MetaICL
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreproduce.sh
64 lines (63 loc) · 2.78 KB
/
reproduce.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
task=$1
method=$2
seed=$3
bs=$4
if [[ $method == *"metaicl" || $method == *"multitask-zero" ]] ; then
checkpoint="checkpoints/${method}/${task}/model.pt"
out_dir="checkpoints/${method}/${task}"
if [[ ! -f $checkpoint ]] ; then
python -m utils.download --checkpoints --setting $task --method $method
fi
else
out_dir="checkpoints/lm"
fi
if [[ $method == "metaicl" ]] ; then
python test.py --task $task --k 16 --split test --seed $seed --use_demonstrations \
--test_batch_size $bs --method direct --checkpoint $checkpoint --out_dir $out_dir
fi
if [[ $method == "channel-metaicl" ]] ; then
python test.py --task $task --k 16 --split test --seed $seed --use_demonstrations \
--test_batch_size $bs --method channel --checkpoint $checkpoint --out_dir $out_dir
fi
if [[ $method == "multitask-zero" ]] ; then
python test.py --task $task --split test \
--test_batch_size $bs --method direct --checkpoint $checkpoint --out_dir $out_dir
fi
if [[ $method == "channel-multitask-zero" ]] ; then
python test.py --task $task --split test \
--test_batch_size $bs --method channel --checkpoint $checkpoint --out_dir $out_dir
fi
if [[ $method == "zero" ]] ; then
python test.py --task $task --k 16 --split test \
--test_batch_size $bs --method direct --out_dir $out_dir --do_zeroshot
fi
if [[ $method == "pmi-zero" ]] ; then
python test.py --task $task --k 16 --split test --is_null \
--test_batch_size $bs --method direct --out_dir $out_dir --do_zeroshot
python test.py --task $task --k 16 --split test --use_calibration \
--test_batch_size $bs --method direct --out_dir $out_dir --do_zeroshot
fi
if [[ $method == "channel-zero" ]] ; then
python test.py --task $task --k 16 --split test \
--test_batch_size $bs --method channel --out_dir $out_dir --do_zeroshot
fi
if [[ $method == "ic" ]] ; then
python test.py --task $task --k 16 --seed $seed --split test \
--test_batch_size $bs --method direct --use_demonstrations --out_dir $out_dir --do_zeroshot
fi
if [[ $method == "pmi-ic" ]] ; then
python test.py --task $task --k 16 --seed $seed --split test --is_null \
--test_batch_size $bs --method direct --use_demonstrations --out_dir $out_dir --do_zeroshot
python test.py --task $task --k 16 --seed $seed --split test --use_calibration \
--test_batch_size $bs --method direct --use_demonstrations --out_dir $out_dir --do_zeroshot
fi
if [[ $method == "channel-ic" ]] ; then
python test.py --task $task --k 16 --seed $seed --split test \
--test_batch_size $bs --method channel --use_demonstrations --out_dir $out_dir --do_zeroshot
fi