|
#!/bin/bash |
|
output_dir=output |
|
|
|
|
|
if [ -n "$1" ]; then |
|
config_file=$1 |
|
fi |
|
|
|
if [ -n "$2" ]; then |
|
model_paths_file=$2 |
|
fi |
|
|
|
|
|
default_step=20 |
|
default_sample_nums=533 |
|
default_sampling_algo="flow_dpm-solver" |
|
default_add_label='' |
|
|
|
default_suffix_label='30K_bs50_Flow_DPM20' |
|
default_log_geneval=false |
|
|
|
|
|
job_name=$(basename $(dirname $(dirname "$model_paths_file"))) |
|
|
|
for arg in "$@" |
|
do |
|
case $arg in |
|
--step=*) |
|
step="${arg#*=}" |
|
shift |
|
;; |
|
--sample_nums=*) |
|
sample_nums="${arg#*=}" |
|
shift |
|
;; |
|
--sampling_algo=*) |
|
sampling_algo="${arg#*=}" |
|
shift |
|
;; |
|
--cfg_scale=*) |
|
cfg_scale="${arg#*=}" |
|
shift |
|
;; |
|
--suffix_label=*) |
|
suffix_label="${arg#*=}" |
|
shift |
|
;; |
|
--add_label=*) |
|
add_label="${arg#*=}" |
|
shift |
|
;; |
|
--log_geneval=*) |
|
log_geneval="${arg#*=}" |
|
shift |
|
;; |
|
--auto_ckpt=*) |
|
auto_ckpt="${arg#*=}" |
|
shift |
|
;; |
|
--auto_ckpt_interval=*) |
|
auto_ckpt_interval="${arg#*=}" |
|
shift |
|
;; |
|
--inference=*) |
|
inference="${arg#*=}" |
|
shift |
|
;; |
|
--geneval=*) |
|
geneval="${arg#*=}" |
|
shift |
|
;; |
|
--tracker_pattern=*) |
|
tracker_pattern="${arg#*=}" |
|
shift |
|
;; |
|
--ablation_key=*) |
|
ablation_key="${arg#*=}" |
|
shift |
|
;; |
|
--ablation_selections=*) |
|
ablation_selections="${arg#*=}" |
|
shift |
|
;; |
|
*) |
|
;; |
|
esac |
|
done |
|
|
|
inference=${inference:-true} |
|
geneval=${geneval:-true} |
|
|
|
step=${step:-$default_step} |
|
cfg_scale=${cfg_scale:-4.5} |
|
sample_nums=${sample_nums:-$default_sample_nums} |
|
sampling_algo=${sampling_algo:-$default_sampling_algo} |
|
exist_time_prefix=${exist_time_prefix:-$default_exist_time_prefix} |
|
add_label=${add_label:-$default_add_label} |
|
ablation_key=${ablation_key:-''} |
|
ablation_selections=${ablation_selections:-''} |
|
|
|
suffix_label=${suffix_label:-$default_suffix_label} |
|
tracker_pattern=${tracker_pattern:-"epoch_step"} |
|
auto_ckpt=${auto_ckpt:-false} |
|
auto_ckpt_interval=${auto_ckpt_interval:-0} |
|
log_geneval=${log_geneval:-$default_log_geneval} |
|
|
|
read -r -d '' cmd <<EOF |
|
bash scripts/infer_metric_run_inference_metric_geneval.sh $config_file $model_paths_file \ |
|
--inference=$inference --geneval=$geneval \ |
|
--step=$step --sample_nums=$sample_nums \ |
|
--exist_time_prefix=$exist_time_prefix --cfg_scale=$cfg_scale \ |
|
--suffix_label=$suffix_label --add_label=$add_label \ |
|
--log_geneval=$log_geneval \ |
|
--output_dir=$output_dir --auto_ckpt=$auto_ckpt --sampling_algo=$sampling_algo \ |
|
--auto_ckpt_interval=$auto_ckpt_interval --tracker_pattern=$tracker_pattern \ |
|
--ablation_key=$ablation_key --ablation_selections="$ablation_selections" |
|
EOF |
|
|
|
echo $cmd '\n' |
|
bash -c "${cmd}" |
|
|