Upload process.sh with huggingface_hub
Browse files- process.sh +33 -0
process.sh
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|