Spaces:
Sleeping
Sleeping
File size: 594 Bytes
842120c |
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 28 29 30 31 32 |
#!/bin/bash
model_name=$1
save_name=$2
pids=()
for i in {0..7}; do
CUDA_VISIBLE_DEVICES=$i python question_evaluate/evaluate.py --model $model_name --suffix $i --save_name $save_name &
pids[$i]=$!
done
wait ${pids[0]}
echo "Task 0 finished."
timeout_duration=3600
(
sleep $timeout_duration
echo "Timeout reached. Killing remaining tasks..."
for i in {1..7}; do
if kill -0 ${pids[$i]} 2>/dev/null; then
kill -9 ${pids[$i]} 2>/dev/null
echo "Killed task $i"
fi
done
) &
for i in {1..7}; do
wait ${pids[$i]} 2>/dev/null
done
|