| # Launch a Flow-CoPD run on the single A100. | |
| # Usage: bash scripts/run_copd.sh <config_fn> | |
| # configs (flow_copd/config_copd.py): text_a0_positive | text_a1_symmetric | text_a2_copd | |
| # pick_a0_positive | pick_a2_copd | |
| # Requires: gated base model downloaded (bash scripts/download_weights.sh --all) + conda env flow_grpo. | |
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # repo root (portable) | |
| export HF_HOME="${HF_HOME:-$ROOT/.hf_cache}" | |
| export TOKENIZERS_PARALLELISM=false | |
| export WANDB_MODE="${WANDB_MODE:-offline}" # don't block on wandb login | |
| export HF_HUB_OFFLINE=0 | |
| cd "$ROOT" | |
| CFG="${1:-text_a0_positive}" | |
| echo "[run_copd] config=$CFG HF_HOME=$HF_HOME" | |
| # use the flow_grpo env's binaries directly. Run as a PLAIN single python process | |
| # (not `accelerate launch`): Accelerator() auto-configures for 1 GPU, and avoiding | |
| # accelerate's subprocess double-fork keeps the job from being reaped when detached. | |
| ENV_BIN="$ROOT/envs/flow_grpo/bin" # persistent prefix env (survives session resets) | |
| export PATH="$ENV_BIN:$PATH" | |
| "$ENV_BIN/python" flow_copd/train_sd3_copd.py --config "flow_copd/config_copd.py:${CFG}" | |