Dual / scripts /restore_selected_checkpoints.sh
zzhongyj's picture
Upload folder using huggingface_hub
cca5a2e verified
Raw
History Blame Contribute Delete
368 Bytes
#!/usr/bin/env bash
set -euo pipefail
OUT=${1:-./checkpoints}
mkdir -p "$OUT"
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
REPO_ROOT=$(cd "$SCRIPT_DIR/.." && pwd)
find "$REPO_ROOT/checkpoint_shards" -name "*.tar" | sort | while read -r shard; do
echo "Extracting $shard"
tar -xf "$shard" -C "$OUT"
done
echo "Restored selected checkpoints to $OUT"