#!/bin/bash
# Batch run concept_load.py for all CSV files in concept100_data

SRC="/home/dslabra5/sae4steer/axbench/axbench/concept100_qwen2.5_3b_data"
OUTDIR="/home/dslabra5/sae4steer/saes-are-good-for-steering/concept"
SCRIPT="/home/dslabra5/sae4steer/saes-are-good-for-steering/src/concept_load.py"

mkdir -p "$OUTDIR"

for csv in "$SRC"/*.csv; do
    base="$(basename "$csv")"
    # Remove the ending "_<score>.csv"
    stem="$(echo "$base" | sed -E 's/_[0-9]+\.[0-9]+\.csv$//')"
    out_name="${stem}_concept_descriptions.json"

    if [[ -f "$OUTDIR/$out_name" ]]; then
        echo "Skip (already exists): $out_name"
        continue
    fi

    echo "Processing: $base -> $out_name"
    python "$SCRIPT" \
        --csv "$csv" \
        --out_dir "$OUTDIR" \
        --out_name "$out_name"
done
