Created
August 9, 2023 11:11
-
-
Save FurkanGozukara/822ed8078dcf8bcfe72a0c81e22d62dc to your computer and use it in GitHub Desktop.
fixed relauncher.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
def relaunch_process(launch_counter=0): | |
''' | |
''' | |
while launch_counter < 1: | |
print('Relauncher: Launching...') | |
if launch_counter > 0: | |
print(f'\tRelaunch count: {launch_counter}') | |
try: | |
launch_string = "/workspace/stable-diffusion-webui/webui.sh -f" | |
os.system(launch_string) | |
except Exception as err: | |
print(f"An error occurred: {err}") | |
finally: | |
print('Relauncher: Process is ending. Relaunching in 2s...') | |
launch_counter += 1 | |
time.sleep(2) | |
if __name__ == "__main__": | |
relaunch_process() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment