mlipaudit-leaderboard / run_app.sh
lcolonn's picture
feat: remove regular files
b10d925 verified
raw
history blame contribute delete
751 Bytes
#!/bin/bash
HF_DATASET_REPO="InstaDeepAI/mlipaudit-results"
HF_DATASET_LOCAL_PATH="/app/results"
echo "Attempting to download dataset from ${HF_DATASET_REPO} to ${HF_DATASET_LOCAL_PATH}..."
# Ensure the local data directory exists
mkdir -p ${HF_DATASET_LOCAL_PATH}
hf download ${HF_DATASET_REPO} --local-dir ${HF_DATASET_LOCAL_PATH} --repo-type dataset
# Find all regular files (-type f) in the downloaded directory and its subdirectories, and delete them.
find "${HF_DATASET_LOCAL_PATH}" -maxdepth 1 -type f -delete
if [ $? -eq 0 ]; then
echo "Dataset downloaded successfully!"
else
echo "Failed to download dataset."
exit 1 # Exit if download fails
fi
echo "Starting Streamlit app..."
exec mlipaudit gui /app/results --is-public