aboutsummaryrefslogtreecommitdiffstats
path: root/webui.sh
diff options
context:
space:
mode:
Diffstat (limited to 'webui.sh')
-rwxr-xr-xwebui.sh34
1 files changed, 20 insertions, 14 deletions
diff --git a/webui.sh b/webui.sh
index 1e728813..c407b3ef 100755
--- a/webui.sh
+++ b/webui.sh
@@ -203,17 +203,23 @@ prepare_tcmalloc() {
fi
}
-if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]
-then
- printf "\n%s\n" "${delimiter}"
- printf "Accelerating launch.py..."
- printf "\n%s\n" "${delimiter}"
- prepare_tcmalloc
- exec accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@"
-else
- printf "\n%s\n" "${delimiter}"
- printf "Launching launch.py..."
- printf "\n%s\n" "${delimiter}"
- prepare_tcmalloc
- exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
-fi
+KEEP_GOING=1
+while [[ "$KEEP_GOING" -eq "1" ]]; do
+ if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]; then
+ printf "\n%s\n" "${delimiter}"
+ printf "Accelerating launch.py..."
+ printf "\n%s\n" "${delimiter}"
+ prepare_tcmalloc
+ accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@"
+ else
+ printf "\n%s\n" "${delimiter}"
+ printf "Launching launch.py..."
+ printf "\n%s\n" "${delimiter}"
+ prepare_tcmalloc
+ "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
+ fi
+
+ if [[ ! -f tmp/restart ]]; then
+ KEEP_GOING=0
+ fi
+done