File size: 947 Bytes
804426a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

export OMP_NUM_THREADS=12
EXAMPLES=/media/dn/work2/nlpu/transformers/examples/question-answering
SQUAD=${EXAMPLES}/scripts/squad2.0
MODEL_PATH=${EXAMPLES}/runs/electra_large_discriminator_squad2_512

python ${EXAMPLES}/run_squad.py \
  --model_type electra \
  --model_name_or_path google/electra-large-discriminator \
  --do_train \
  --do_eval \
  --train_file ${SQUAD}/train-v2.0.json \
  --predict_file ${SQUAD}/dev-v2.0.json \
  --version_2_with_negative \
  --do_lower_case \
  --num_train_epochs 3 \
  --warmup_steps 306 \
  --weight_decay 0.01 \
  --learning_rate 3e-5 \
  --max_grad_norm 0.5 \
  --adam_epsilon 1e-6 \
  --max_seq_length 512 \
  --doc_stride 128 \
  --per_gpu_train_batch_size 8 \
  --gradient_accumulation_steps 16 \
  --per_gpu_eval_batch_size 128 \
  --fp16 \
  --fp16_opt_level O1 \
  --threads 12 \
  --logging_steps 50 \
  --save_steps 1000 \
  --overwrite_output_dir \
  --output_dir ${MODEL_PATH}
$@