#!/bin/bash
# Aggressive LoRA fine-tune SVD on LIBERO - high rank, high LR, 128x128

export CUDA_VISIBLE_DEVICES=7
export ACCELERATE_TORCH_DEVICE="cuda:0"
export PROJECT="svd-libero-lora-aggressive"

cd /data/cameron/vidgen/svd_motion_lora/Motion-LoRA

eval "$(conda shell.bash hook)"
conda activate motionlora

accelerate launch \
    --config_file scripts/accelerate_configs/single_gpu_b.yaml \
    train_svd.py \
    --pretrained_model_name_or_path=checkpoints/stable-video-diffusion-img2vid-xt-1-1 \
    --per_gpu_batch_size=1 --gradient_accumulation_steps=1 \
    --max_train_steps=6000 \
    --width=128 \
    --height=128 \
    --checkpointing_steps=500 --checkpoints_total_limit=5 \
    --learning_rate=5e-4 --lr_warmup_steps=0 \
    --seed=42 \
    --mixed_precision="bf16" \
    --dataset_path="dataset/libero" \
    --validation_steps=200 \
    --num_validation_images=1 \
    --validation_image_path="dataset/validation_images" \
    --gradient_checkpointing \
    --num_frames=25 \
    --output_dir='./output_libero_lora_aggressive' \
    --train_lora \
    --rank=128 \
    --report_to "wandb"
