#!/bin/bash while true; do echo "Checking and installing required packages..." pip install torch torchvision torchaudio diffusers gradio --upgrade echo "Running the gradio_interface.py script..." python ~/ai-dreams-x/gradio_interface.py if [ $? -eq 0 ]; then echo "Script ran successfully!" break else echo "An error occurred. Retrying in 5 seconds..." sleep 5 fi done