aboutsummaryrefslogtreecommitdiff
path: root/webui.sh
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-04 11:17:20 +0300
committerGitHub <noreply@github.com>2023-06-04 11:17:20 +0300
commit0819383de05e57ec5da638bd4d5d180b5bac981a (patch)
treeecec2c764772b337167248382fd7b72cdcef3209 /webui.sh
parentefc4c79b5ecd0bfff09b5f7bb9acf4b9044207ae (diff)
parent333e63c0911c148ea306d7b72580d5c6d2f2c41a (diff)
Merge pull request #10975 from AUTOMATIC1111/restart3
A yet another method to restart webui.
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