#!/bin/bash
#SBATCH -p AI4Phys
#SBATCH --job-name=random
#SBATCH --output=yield_pred_random.output
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=32
#SBATCH --gres=gpu:2

source activate llama-factory


# MASTER_ADDR=`scontrol show hostname $SLURM_JOB_NODELIST | head -n1`
# MASTER_PORT=$((RANDOM % 101 + 20000))

# export MASTER_ADDR=$MASTER_ADDR
# export MASTER_PORT=$MASTER_PORT
# echo $MASTER_ADDR
# echo $MASTER_PORT

# function makehostfile() {
# perl -e '$slots=split /,/, $ENV{"SLURM_STEP_GPUS"};
# $slots=8 if $slots==0; # workaround 8 gpu machines
# @nodes = split /\n/, qx[scontrol show hostnames $ENV{"SLURM_JOB_NODELIST"}];
# print map { "$b$_ slots=$slots\n" } @nodes'
# }
# makehostfile > hostfile
# hostfile=""


# --include='localhost' \

python save_embs_yields.py \
   --pretrained_model_path '/mnt/hwfile/ai4chem/share/step1_llama3_8b_0916_yearly_pistachio_ep3' \
   --lora_adapter_path "/mnt/hwfile/ai4chem/chenjianpeng/train_regression/llama_ep3_1115-18/lora_adapter" \
   --save_root './eval_results/train_regression_fg_changes_random/' \
   --data_path './data4regression/' \
   --data_name 'suzuki_miyaura_fg_changes_random' \
   --batch_size 4 \
   --use_lora 1 \
   --state_dict_path /mnt/hwfile/ai4chem/handong/suzuki_miyaura_fg_changes_random/final/ \
   --log_file "save_random_embs_yields.log" \
   --load_ds_ckpt_id final

