-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_biencoder_codebert_pl_fp16.sh
47 lines (38 loc) · 1.21 KB
/
run_biencoder_codebert_pl_fp16.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
export CUDA_VISIBLE_DEVICES=2
# 14G, 2.5h
pl=$1 # name of programming language
MODEL_DIR="tmp/bi_fp16_codebert_${pl}"
EMBEDDINGS_DIR="tmp/bi_fp16_codebert_embeddings_${pl}"
RESULT_DIR="tmp/bi_fp16_codebert_result_${pl}"
mkdir -p $RESULT_DIR
python run_biencoder.py \
--model_name_or_path microsoft/codebert-base \
--output_dir $MODEL_DIR \
--data_file ../pls/qa.en.${pl}.json \
--train_group_size 1 \
--do_train \
--per_device_train_batch_size 32 \
--num_train_epochs 3 \
--do_eval \
--per_device_eval_batch_size 64 \
--save_strategy epoch \
--evaluation_strategy epoch \
--overwrite_output_dir \
--logging_steps 100 \
--fp16
python run_biencoder.py \
--model_name_or_path $MODEL_DIR \
--output_dir $MODEL_DIR \
--data_file ../pls/qa.en.${pl}.json \
--do_predict \
--prediction_save_path $EMBEDDINGS_DIR \
--encode_corpus \
--encode_query \
--overwrite_output_dir \
--fp16
python test.py \
--query_reps_path $EMBEDDINGS_DIR/query_reps \
--passage_reps_path $EMBEDDINGS_DIR/passage_reps \
--qrels_file $EMBEDDINGS_DIR/qrels.test.tsv \
--ranking_file $EMBEDDINGS_DIR/test_ranking.txt \
> ${RESULT_DIR}/result.log 2>&1