Datasets:
LEAP
/

ArXiv:
License:
juannat7 commited on
Commit
5dd4378
1 Parent(s): 5a3c85b

Upload process.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. process.sh +31 -16
process.sh CHANGED
@@ -1,33 +1,48 @@
1
- #!/bin/bash
 
 
 
 
 
 
2
 
3
  # Base URL for the chunked files
4
- BASE_URL="https://huggingface.co/datasets/juannat7/ChaosBench/resolve/main/$1/"
5
 
6
  # The base name of the files (without extension)
7
  BASE_NAME="$1_chunks"
8
 
9
  # Extension for the chunked files
10
- EXTENSION="zip"
11
 
12
  # Download all chunked files
13
- wget "${BASE_URL}${BASE_NAME}.${EXTENSION}"
14
- for i in $(seq -f "%02g" 1 99); do
15
- FILE_NAME="${BASE_URL}${BASE_NAME}.z${i}"
16
- wget "${FILE_NAME}" || break
 
17
  done
18
 
19
  # Combine the chunked files
20
- zip -F "${BASE_NAME}.${EXTENSION}" --out "$1".zip
21
 
22
  # Remove the chunked files
23
- rm "${BASE_NAME}.${EXTENSION}"
24
- for i in $(seq -f "%02g" 1 99); do
25
- rm "${BASE_NAME}.z${i}" || break
26
- done
 
 
 
 
 
 
 
 
 
 
27
 
28
- # Unzip the combined file
29
- unzip "$1".zip
30
 
31
- # Remove the combined zip file
32
- rm "$1".zip
33
 
 
1
+ #!/bin/sh
2
+ #
3
+ #SBATCH --account=glab
4
+ #SBATCH -N 1
5
+ #SBATCH -c 24
6
+ #SBATCH --mem=100gb
7
+ #SBATCH --time=05-00:00
8
 
9
  # Base URL for the chunked files
10
+ BASE_URL="https://huggingface.co/datasets/LEAP/ChaosBench/resolve/main/$1/"
11
 
12
  # The base name of the files (without extension)
13
  BASE_NAME="$1_chunks"
14
 
15
  # Extension for the chunked files
16
+ EXTENSION="tar.gz"
17
 
18
  # Download all chunked files
19
+ for prefix in {a..z}; do
20
+ for suffix in {a..z}; do
21
+ FILE_NAME="${BASE_NAME}.${EXTENSION}.${prefix}${suffix}"
22
+ wget "${BASE_URL}${FILE_NAME}" || break 2
23
+ done
24
  done
25
 
26
  # Combine the chunked files
27
+ cat ${BASE_NAME}.${EXTENSION}.* > "$1".tar.gz
28
 
29
  # Remove the chunked files
30
+ rm ${BASE_NAME}.${EXTENSION}.*
31
+
32
+ # Extract the combined file
33
+ echo "EXTRACTING FOLDER, THIS MAY TAKE A WHILE..."
34
+ if [ "$2" == "with_pigz" ]; then
35
+ echo "Use pigz for parallel decompression..."
36
+ pigz -dc "$1".tar.gz | tar -xf -
37
+ else
38
+ # Use standard tar for decompression
39
+ tar -xzf "$1".tar.gz
40
+ fi
41
+
42
+ # Remove the combined compressed file
43
+ rm "$1".tar.gz
44
 
45
+ # Rename folder
46
+ mv "$1"_tmp "$1"
47
 
 
 
48