#!/bin/bash -l

# SLURM SUBMIT SCRIPT
#SBATCH --job-name=unwrap
#SBATCH --nodes=1             # This needs to match Trainer(num_nodes=...)
#SBATCH --gres=gpu:8
#SBATCH --ntasks-per-node=8   # This needs to match Trainer(devices=...)

# ACTIVATE ANACONDA
eval "$(conda shell.bash hook)"

# activate conda env
conda activate stable-audio-tools-env

# debugging flags (optional)
export NCCL_DEBUG=INFO
export PYTHONFAULTHANDLER=1

# on your cluster you might need these:
# set the network interface
# export NCCL_SOCKET_IFNAME=^docker0,lo

# might need the latest CUDA
#module load NCCL/2.4.7-1-cuda.10.0

# unwrap autoencoder
#python3 ./unwrap_model.py \
#--model-config stable_audio_tools/configs/model_configs/autoencoders/stable_audio_2_0_vae_48khz.json \
#--ckpt-path /home/christian/christian/stable-audio-tools/harmonai_train/usj037d6/checkpoints/epoch=61-step=1350000.ckpt \
#--name vae_model_unwrap-epoch=61-step=1350000

# unwrap upsample model (semantic)
#python3 ./unwrap_model.py \
#--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic_48khz.json \
#--ckpt-path /home/christian/christian/stable-audio-tools/harmonai_train/mj07h6b3/checkpoints/epoch=0-step=10000.ckpt \
#--name upsample_model_semantic_unwrap-epoch=0-step=10000

# unwrap upsample model (codec)
#python3 ./unwrap_model.py \
#--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_codec_48khz.json \
#--ckpt-path /home/christian/christian/stable-audio-tools/harmonai_train/2zp4baao/checkpoints/epoch=45-step=370000.ckpt \
#--name upsample_model_codec_unwrap-epoch=45-step=370000


# unwrap upsample model (semantic_v2)
#python3 ./unwrap_model.py \
#--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic_v2_48khz.json \
#--ckpt-path /home/christian/christian/neon/stable-audio-tools/harmonai_train/nyi5ds5z/checkpoints/epoch=0-step=160000.ckpt \
#--name upsample_model_semantic_v2_unwrap-christian-epoch=0-step=160000

# unwrap upsample model (semantic+codec)
python3 ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic_v2+codec_v2_48khz.json \
--ckpt-path /home/christian/christian/neon/stable-audio-tools/harmonai_train/4l50c8ps/checkpoints/epoch=0-step=2230000.ckpt \
--name upsample_model_semantic_v2+codec_v2_unwrap-christian-epoch=0-step=2230000

CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic_48khz_lg.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/yv1ry1st/checkpoints/epoch=0-step=950000.ckpt \
--name diffusion_s1_25hz_1b_epoch=0-step=950000

CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_discrete_48khz_lg_vae.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/nrcaqabw/checkpoints/epoch=12-step=590000.ckpt \
--name diffusion_s1_vae_100hz_1b_epoch=12-step=590000


# spot_genres
CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_uncond_48khz_lg_vae.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/wmeus257/checkpoints/epoch=20-step=570000.ckpt \
--name diffusion_uncond_spot_genres_vae_100hz_1b_epoch=20-step=570000

# tiktok
CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_uncond_48khz_lg_vae.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/rfm1el95/checkpoints/last.ckpt \
--name diffusion_uncond_tiktok_covers_vae_100hz_1b_last

# genius_hq_filtered
CUDA_VISIBLE_DEVICES=3 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_uncond_48khz_lg_vae.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/ru6ko6mp/checkpoints/epoch=43-step=690000.ckpt \
--name diffusion_uncond_genius_hq_filtered_vae_100hz_1b_epoch=43-step=690000


# genius_hq_lyrics
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_lyrics_48khz_lg_vae.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/bxh3vai6/checkpoints/epoch=11-step=250000.ckpt \
--name diffusion_lyrics_genius_hq_lyrics_vae_100hz_1b_epoch=11-step=250000

# -------------------------------- semantic + text --------------------------------

# vae semantic + text large
CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/zfmhnjcd/checkpoints/epoch=15-step=2360000.ckpt \
--name diffusion_semantic+text_100hz_1b_full_scale=2.5_epoch=15-step=2360000

# vae semantic + text sm
CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_sm_scale=2.5.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/8t9k0k5e/checkpoints/epoch=6-step=1040000.ckpt \
--name diffusion_semantic+text_100hz_200m_scale=2.5_epoch=6-step=1040000


# resume learning rate decay
CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/bjgodws5/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_1b_scale=2.5_epoch=last-ft


# finetune 6min context with local attention
CUDA_VISIBLE_DEVICES=1 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_ft.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/50rj9483/checkpoints/epoch=0-step=32000.ckpt \
--name diffusion_semantic+text_100hz_1b_full_scale=2.5_6min_epoch=0-step=32000

# 2min model base
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes_no_ema.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/bemjcr2f/checkpoints/epoch=14-step=580000.ckpt \
--name diffusion_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes_2min_epoch=14-step=580000

#2 min 25hz no val step
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/wz8fc0h9/checkpoints/last.ckpt \
--name diffusion_semantic+text_25hz_lg_scale=2.5_qk_norm_adaln_phonemes_2min_no_val_step=2400000

#2 min 1 node
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/872r1d6z/checkpoints/epoch=22-step=1200000.ckpt \
--name diffusion_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes_2min_1node_epoch=22-step=1200000



# 6min base model
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes_mask.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/g7etrlgw/checkpoints/last.ckpt \
--name diffusion_semantic+text_25hz_lg_scale=2.5_qk_norm_adaln_phonemes_6min_no_val_step=1000000


# 2min phonemes fix
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes_fix.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/0z35d15d/checkpoints/last.ckpt \
--name diffusion_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes_fix_2min_last

# 2min 2b
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_vlg_scale=2.5_qk_norm_adaln.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/vu3kpq2j/checkpoints/last.ckpt \
--name diffusion_semantic+text_48khz_vlg_scale=2.5_qk_norm_adaln_2min_step=190000

# 2min 100hz 1 node
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_legacy.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/ieghyvhs/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_qk_norm_legacy_2min_step=2200000

# 4min 100hz 16 node
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_20_scale=2.5_qk_norm.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/2mnreral/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_20_scale=2.5_qk_norm_4min_step=380000

# 2min 100hz 16 node
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/3fhnp5mz/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_qk_norm_2min_step=1600000

# 30s chunk finetune (h652imqm)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_infill.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/h652imqm/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_infill_30s_chunk_ft_step=400000

# 30s chunk finetune (cuyzft4f)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_infill.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/cuyzft4f/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_infill_30s_chunk_ft_step=20000

# 30s chunk finetune (vky8nwhb)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_infill.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/vky8nwhb/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_infill_v4_30s_chunk_ft_step=400000

# 25hz 2min shift factor 6
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_adaln_phonemes_shift.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/zep7uc42/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_qk_norm_30s_step=800000

# 100hz 30s new data (yhgs7ibp)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/yhgs7ibp/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_qk_norm_30s_step=1200000

# 100hz 30s new data context bugfix 1 node (w8i7e6x8)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_infill.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/w8i7e6x8/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_infill_v5_30s_chunk_ft_step=1200000

# 100hz full lyrics ft (5w0ibdsw)   
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/5w0ibdsw/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_full_lyrics_ft_step=400000

# 100hz 30s ft new init (8opy0my4)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_infill_cos.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/8opy0my4/checkpoints/last.ckpt \
--name mv d

# (367q7s1t) centre only
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_infill_cos.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/367q7s1t/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_infill_v5_30s_chunk_ft_center_only_step=20000

# 25hz 30s 1 node
# (tt96sbbx)

# ()
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/tt96sbbx/checkpoints/last.ckpt \
--name diffusion_semantic+text_25hz_lg_scale=2.5_qk_norm_30s_step=1700000

# (n3zytu2z)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.0_qk_norm.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/n3zytu2z/checkpoints/last.ckpt \
--name diffusion_semantic+text_25hz_lg_scale=2.0_qk_norm_30s_step=1500000

# /home/christian/code/neon/stable-audio-tools/stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5.json
# /home/christian/code/neon/stable-audio-tools/checkpoints/diffusion_semantic+text_100hz_1b_full_scale=2.5_epoch=3-step=480000.ckpt
# /home/christian/code/neon/stable-audio-tools/checkpoints/diffusion_semantic+text_100hz_1b_full_scale=2.5_epoch=7-step=1140000.ckpt
# /home/christian/code/neon/stable-audio-tools/checkpoints/diffusion_semantic+text_100hz_1b_full_scale=2.5_epoch=9-step=1520000.ckpt
#/home/christian/code/neon/stable-audio-tools/checkpoints/diffusion_semantic+text_100hz_1b_full_scale=2.5_epoch=15-step=2360000.ckpt

# () 100hz 30s logit norm
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_qk_norm_logit_norm.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/nr900ae8/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_qk_norm_logit_norm_30s_step=180000

# 100hz 30s context (t9ks70go)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_context.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/t9ks70go/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_context_30s_step=360000

# 100hz 30s context with dropout (u2u7da6h)
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_context.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/u2u7da6h/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_context_dropout_30s_step=360000

# 100hz 30s context with dropout and alignments (1ergguj2) 8n
CUDA_VISIBLE_DEVICES=2 python ./unwrap_model.py \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_scale=2.5_context.json \
--ckpt-path /home/christian/code/neon/stable-audio-tools/harmonai_train/1ergguj2/checkpoints/last.ckpt \
--name diffusion_semantic+text_100hz_lg_scale=2.5_context_alignments_30s_step=160000


