#!/bin/bash


export CUDA_VISIBLE_DEVICES=0
while true; do
    echo "Launching"
    python -m jaxlm.applications.optimize_canaries

    EXIT_CODE=$?
    if [ $EXIT_CODE -eq 0 ]; then
        echo "Finished successfully."
        break
    else
        echo "Failed with exit code $EXIT_CODE. Restarting..."
        sleep 1 
    fi
done
