RunyiY's picture
Upload structured3d/merge.sh with huggingface_hub
d431f60 verified
#!/bin/bash
# Merge script for structured3d dataset
# This script reassembles chunks back into the original structured3d.tar.gz file
DATASET_NAME="structured3d"
OUTPUT_FILE="structured3d.tar.gz"
echo "Merging $DATASET_NAME chunks"
echo "============================="
if [ ! -d "chunks" ]; then
echo "Error: chunks directory not found"
echo "Run ./split.sh first or ./download.py to get chunks"
exit 1
fi
# Check if chunks exist
if [ ! -f "chunks/${DATASET_NAME}_part_000" ]; then
echo "Error: No chunks found in chunks directory"
echo "Expected files like ${DATASET_NAME}_part_000, ${DATASET_NAME}_part_001, etc."
exit 1
fi
echo "Found chunks:"
ls -lh chunks/${DATASET_NAME}_part_* | awk '{print " " $9 ": " $5}'
echo
echo "Reassembling $OUTPUT_FILE..."
# Merge chunks in correct order
cat chunks/${DATASET_NAME}_part_* > "$OUTPUT_FILE"
if [ $? -eq 0 ]; then
echo "✓ Successfully reassembled $OUTPUT_FILE"
echo "File size: $(ls -lh "$OUTPUT_FILE" | awk '{print $5}')"
echo
echo "Next steps:"
echo "1. Run ./extract.sh to extract the contents"
echo "2. Verify the file integrity if needed"
else
echo "✗ Failed to reassemble $OUTPUT_FILE"
exit 1
fi