#!/bin/bash
# 1. For each soure task we need to fine-tune on 32 samples. Few shot then get label.

# save datasets in the folder > pseudo_label_dataset.pickle

# target dataset
dataset_target='superglue-multirc'

#export CUDA_VISIBLE_DEVICES='0'
##1.1 mnli: source datasets
#dataset='mnli'
#json_file="./attempt/configs/self_training/source_${dataset}.json"
#save_dir="./outputs/self_training/self_fs_s_${dataset}_t_${dataset_target}"
#mkdir -p $save_dir
#
#nohup python \
#  attempt/seq2seq/few_shot.py \
#  --json_file $json_file \
#  --dataset_target $dataset_target \
#  --save_dir $save_dir \
#  --self_train \
#  --perplexity_calc \
#  > ${save_dir}/debug.log 2>&1 &

#export CUDA_VISIBLE_DEVICES='1'
##1.2 qnli source datasets
#dataset='qnli'
#json_file="./attempt/configs/self_training/source_${dataset}.json"
#save_dir="./outputs/self_training/self_fs_s_${dataset}_t_${dataset_target}"
#mkdir -p $save_dir
#
#nohup python \
#  attempt/seq2seq/few_shot.py \
#  --json_file $json_file \
#  --dataset_target $dataset_target \
#  --save_dir $save_dir \
#  --self_train \
#  --perplexity_calc \
#  > ${save_dir}/debug.log 2>&1 &
#
#export CUDA_VISIBLE_DEVICES='2'
##1.3 qqp source datasets
#dataset='qqp'
#json_file="./attempt/configs/self_training/source_${dataset}.json"
#save_dir="./outputs/self_training/self_fs_s_${dataset}_t_${dataset_target}"
#mkdir -p $save_dir
#
#nohup python \
#  attempt/seq2seq/few_shot.py \
#  --json_file $json_file \
#  --dataset_target $dataset_target \
#  --save_dir $save_dir \
#  --self_train \
#  --perplexity_calc \
#  > ${save_dir}/debug.log 2>&1 &
#
#
#export CUDA_VISIBLE_DEVICES='0'
##1.4 sst2 source datasets
#dataset='sst2'
#json_file="./attempt/configs/self_training/source_${dataset}.json"
#save_dir="/export/home/OpenPrompt/mixture_prompt/outputs/self_training/self_fs_s_${dataset}_t_${dataset_target}"
#fewshot_num=20
#fewshot_num_begin=15
#mkdir -p $save_dir
#
#nohup python \
#  attempt/seq2seq/few_shot.py \
#  --json_file $json_file \
#  --dataset_target $dataset_target \
#  --save_dir $save_dir \
#  --self_train \
#  --perplexity_calc \
#  --fewshot_num_begin $fewshot_num_begin \
#  --fewshot_num $fewshot_num \
#  > ${save_dir}/debug_4.log 2>&1 &
#
#export CUDA_VISIBLE_DEVICES='4'
##1.5 squad: source datasets
#dataset='squad'
#json_file="./attempt/configs/self_training/source_${dataset}.json"
#save_dir="./outputs/self_training/self_fs_s_${dataset}_t_${dataset_target}"
#mkdir -p $save_dir
#
#nohup python \
#  attempt/seq2seq/few_shot.py \
#  --json_file $json_file \
#  --dataset_target $dataset_target \
#  --save_dir $save_dir \
#  --self_train \
#  --perplexity_calc \
#  > ${save_dir}/debug.log 2>&1 &
#
export CUDA_VISIBLE_DEVICES='5'
#1.6 record: source datasets
dataset='record'
json_file="./attempt/configs/self_training/source_${dataset}.json"
save_dir="./outputs/self_training/self_fs_s_${dataset}_t_${dataset_target}"
mkdir -p $save_dir

nohup python \
  attempt/seq2seq/few_shot.py \
  --json_file $json_file \
  --dataset_target $dataset_target \
  --save_dir $save_dir \
  --self_train \
  --perplexity_calc \
  > ${save_dir}/debug.log 2>&1 &
