#!/bin/bash

# Vocal Captions and Pitch Range Integration - Development Test
# Based on sample permutation test pattern - smaller model, no FSDP, local training
# Uses CUDA devices 2,3 for testing

echo "Starting Vocal Captions and Pitch Range Integration Test..."
echo "CUDA Device: 2,3"
echo "Testing vocal captions and pitch range integration with:"
echo "  - Vocal caption extraction from stems_captions"
echo "  - Pitch range control tags (vocal_pitch_hz_min/max)"
echo "  - Two-path vocal tag processing (merged vs separate)"

cd /home/vibert/projects/neon-voice-data/sunoGPT && \
CUDA_VISIBLE_DEVICES=4,5 /home/vibert/anaconda3/envs/suno_3/bin/python -u train.py \
    --out_dir="/app2/suno/checkpoints/vocal_captions_pitch_range_full_test" \
    --data_dir="/app2/suno/data/auk_v0" \
    --train_metas_filename="metas_v9_tr.jsonl" \
    --val_metas_filename="/app2/suno/data/auk_v0/metas_v8_val.jsonl" \
    --step_save_iters=500 \
    --eval_interval=100 \
    --eval_iters=3 \
    --batch_store_size=1 \
    \
    --n_layer=1 \
    --n_head=16 \
    --d_head=64 \
    \
    --learning_rate=1e-4 \
    --max_iters=500 \
    --warmup_iters=0 \
    --batch_size=1 \
    \
    --fsdp=False \
    --grad_checkpointing=False \
    --compile=False \
    --checkpoint_save_old_format=False \
    \
    --wandb_log=False \
    --preload_optimizer=False \
    --allow_skip=True \
    --use_hoot=False \
    2>&1 | tee /tmp/vocal_captions_pitch_range_full_test.log

echo "Vocal captions and pitch range integration test completed!"
echo "Check logs for vocal caption processing and pitch range control tag generation."
echo "Expected: Vocal tags with suffixes and [vocal:...] elements in training data"
echo "Look for messages containing vocal captions and pitch range control tags"