Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IRT Branch] IRT update #1278

Open
wants to merge 1 commit into
base: IRT_experiments
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion irt_scripts/run_predict_results.sbatch
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ mkdir -p ${BASE_PATH}/experiments/predict_files/${model}

echo "${model} ${task} ${config_no} ${model_path}"

SHORT_MODEL_NAME="${MODEL_TYPE##*/}"

python $JIANT_PATH/proj/main/runscript.py run \
--ZZsrc ${BASE_PATH}/models/${model}/config.json \
--hf_pretrained_model_name_or_path ${MODEL_TYPE} \
--model_path ${MODELS_DIR}/${SHORT_MODEL_NAME}/model/model.p \
--model_config_path ${MODELS_DIR}/${SHORT_MODEL_NAME}/model/config.json \
--jiant_task_container_config_path ${BASE_PATH}/experiments/run_config_dir/taskmaster/${model}/${task}_${config_no}/${task}.json \
--model_load_mode all --model_path ${BASE_PATH}/experiments/output_dir/taskmaster_${model}_bestconfig/${task}/config_${config_no}/${model_path} \
--output_dir ${BASE_PATH}/experiments/predict_files/${model}/${task}_config_${config_no}_${model_path} \
Expand Down
26 changes: 11 additions & 15 deletions irt_scripts/run_preprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,22 @@ function prepare_all_tasks() {


function preprocess_task(){
# Full model name e.g. nyu-mll/roberta-base-100M-1, roberta-base
MODEL_TYPE=$1
TASK_NAME=$2

if [[ $MODEL_TYPE = nyu* ]]
then
MODEL_NAME="${MODEL_TYPE##*/}"
else
MODEL_NAME=${MODEL_TYPE}
fi
echo "$MODEL_NAME: ${TASK_NAME}, ${DATA_DIR}"
# Model name e.g. roberta-base-100M-1, roberta-base
SHORT_MODEL_NAME="${MODEL_TYPE##*/}"
echo "${SHORT_MODEL_NAME}: ${TASK_NAME}, ${DATA_DIR}"

python ${JIANT_PATH}/proj/main/tokenize_and_cache.py \
--task_config_path ${DATA_DIR}/configs/${TASK_NAME}_config.json \
--model_type ${MODEL_NAME} \
--model_tokenizer_path ${MODELS_DIR}/${MODEL_NAME}/tokenizer \
--phases train,val,test \
--max_seq_length 256 \
--do_iter \
--smart_truncate \
--output_dir ${CACHE_DIR}/${MODEL_NAME}/${TASK_NAME}
--task_config_path ${DATA_DIR}/configs/${TASK_NAME}_config.json \
--hf_pretrained_model_name_or_path ${MODEL_TYPE} \
--phases train,val,test \
--max_seq_length 256 \
--do_iter \
--smart_truncate \
--output_dir ${CACHE_DIR}/${SHORT_MODEL_NAME}/${TASK_NAME}
}


Expand Down
5 changes: 4 additions & 1 deletion irt_scripts/run_train_task.sbatch
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ echo $RUN_CONFIG_DIR
echo $SEED
export PYTHONPATH=jiant/

SHORT_MODEL_NAME="${MODEL_TYPE##*/}"

python $JIANT_PATH/proj/main/runscript.py \
run_with_continue \
--ZZsrc ${MODELS_DIR}/${MODEL_TYPE}/config.json \
--jiant_task_container_config_path ${RUN_CONFIG_DIR} \
--hf_pretrained_model_name_or_path ${MODEL_TYPE} \
--model_path ${MODELS_DIR}/${SHORT_MODEL_NAME}/model/model.p \
--model_config_path ${MODELS_DIR}/${SHORT_MODEL_NAME}/model/config.json \
--model_load_mode from_transformers \
--learning_rate $LR \
--force_overwrite \
Expand Down