Download scripts/batch_sample_diffusion.sh from OneScience-Group/TargetDiff: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/OneScience-Group/TargetDiff/resolve/3f4bfb540c16acf7d89c469c4e1777fabc69090d/scripts/batch_sample_diffusion.sh
- Command line
-
hf download hf://OneScience-Group/TargetDiff@3f4bfb540c16acf7d89c469c4e1777fabc69090d/scripts/batch_sample_diffusion.sh
-
curl -L -o batch_sample_diffusion.sh https://huggingface.co/OneScience-Group/TargetDiff/resolve/3f4bfb540c16acf7d89c469c4e1777fabc69090d/scripts/batch_sample_diffusion.sh
498 Bytes
| TOTAL_TASKS=100 | |
| BATCH_SIZE=50 | |
| if [ $# != 5 ]; then | |
| echo "Error: 5 arguments required." | |
| exit 1 | |
| fi | |
| CONFIG_FILE=$1 | |
| RESULT_PATH=$2 | |
| NODE_ALL=$3 | |
| NODE_THIS=$4 | |
| START_IDX=$5 | |
| for ((i=$START_IDX;i<$TOTAL_TASKS;i++)); do | |
| NODE_TARGET=$(($i % $NODE_ALL)) | |
| if [ $NODE_TARGET == $NODE_THIS ]; then | |
| echo "Task ${i} assigned to this worker (${NODE_THIS})" | |
| python -m scripts.sample_diffusion ${CONFIG_FILE} -i ${i} --batch_size ${BATCH_SIZE} --result_path ${RESULT_PATH} | |
| fi | |
| done | |