Skip to content

Commit

Permalink
Add auto data download for all scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
research4pan committed Aug 7, 2023
1 parent db91533 commit dff1f92
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/run_evaluation.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

if [ ! -d data/MedQA-USMLE ]; then
cd data && ./download.sh MedQA-USMLE && cd -
fi

CUDA_VISIBLE_DEVICES=0 \
deepspeed examples/evaluation.py \
--answer_type medmcqa \
Expand Down
4 changes: 4 additions & 0 deletions scripts/run_evaluation_accelerator.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

if [ ! -d data/MedQA-USMLE ]; then
cd data && ./download.sh MedQA-USMLE && cd -
fi

CUDA_VISIBLE_DEVICES=0 accelerate launch --config_file configs/accelerator_singlegpu_config.yaml examples/evaluation.py \
--answer_type usmle \
--model_name_or_path gpt2-large \
Expand Down
5 changes: 5 additions & 0 deletions scripts/run_evaluation_with_lora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# --model_name_or_path specifies the original huggingface model
# --lora_model_path specifies the model difference introduced by finetuning,
# i.e. the one saved by ./scripts/run_finetune_with_lora.sh

if [ ! -d data/alpaca ]; then
cd data && ./download.sh alpaca && cd -
fi

CUDA_VISIBLE_DEVICES=0 \
deepspeed examples/evaluation.py \
--answer_type text \
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_multistage_finetune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ project_dir=$(cd "$(dirname $0)"/..; pwd)
output_dir=${project_dir}/output_models/${exp_id}
log_dir=${project_dir}/log/${exp_id}
dataset_path="${project_dir}/data/example_dataset/train"
if [ ! -d ${dataset_path} ]; then
cd data && ./download.sh example_dataset && cd -
fi

mkdir -p ${output_dir} ${log_dir}

Expand Down
4 changes: 4 additions & 0 deletions scripts/run_raft_align.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ project_dir=$(cd "$(dirname $0)"/..; pwd)
output_dir=${project_dir}/output_models/${exp_id}
log_dir=${project_dir}/log/${exp_id}

if [ ! -d data/hh_rlhf ]; then
cd data && ./download.sh hh_rlhf && cd -
fi

mkdir -p ${output_dir} ${log_dir}

export PYTHONPATH=.
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_reward_modeling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ output_dir=${project_dir}/output_models/${exp_id}
log_dir=${project_dir}/log/${exp_id}

dataset_path=${project_dir}/data/hh_rlhf/rm/hh_rlhf_rm_training.json
if [ ! -d data/hh_rlhf ]; then
cd data && ./download.sh hh_rlhf && cd -
fi

mkdir -p ${output_dir} ${log_dir}

Expand Down

0 comments on commit dff1f92

Please sign in to comment.