forked from stanford-cs336/assignment4-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_assets.sh
More file actions
executable file
·27 lines (23 loc) · 1.02 KB
/
get_assets.sh
File metadata and controls
executable file
·27 lines (23 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# Define the target directory
SOURCE_DIR="/data/classifiers"
ASSETS_DIR="$(pwd)/cs336_data/assets"
# Function to handle each file
handle_file() {
local filename=$1
local url=$2
# Check if file exists in target directory
if [ -e "$ASSETS_DIR/$filename" ]; then
echo "File $filename already exists in $ASSETS_DIR, skipping..."
# Check if file exists in source directory
elif [ -f "$SOURCE_DIR/$filename" ]; then
echo "File $filename exists in $SOURCE_DIR, creating softlink..."
ln -s "$SOURCE_DIR/$filename" "$ASSETS_DIR/$filename"
else
echo "File $filename not found in $SOURCE_DIR, downloading..."
wget "$url" -O "$ASSETS_DIR/$filename"
fi
}
# Handle each file
handle_file "dolma_fasttext_nsfw_jigsaw_model.bin" "https://huggingface.co/allenai/dolma-jigsaw-fasttext-bigrams-nsfw/resolve/main/model.bin"
handle_file "dolma_fasttext_hatespeech_jigsaw_model.bin" "https://huggingface.co/allenai/dolma-jigsaw-fasttext-bigrams-hatespeech/resolve/main/model.bin"