Update launch.py
Browse files
launch.py
CHANGED
@@ -15,37 +15,48 @@ args.gradio_queue = True
|
|
15 |
args.multiple = True
|
16 |
args.no_download_sd_model = True
|
17 |
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
-
|
25 |
-
console_handler = logging.StreamHandler(sys.stdout)
|
26 |
-
console_handler.setLevel(logging.INFO)
|
27 |
-
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
|
28 |
-
console_handler.setFormatter(formatter)
|
29 |
-
logging.getLogger().addHandler(console_handler)
|
30 |
|
31 |
-
|
32 |
-
sys.stdout = logging.getLogger().handlers[0].stream
|
33 |
-
sys.stderr = logging.getLogger().handlers[0].stream
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
|
41 |
if args.test_server:
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
finally:
|
49 |
-
# 最后,关闭日志处理程序,以确保所有日志都被写入到日志文件
|
50 |
-
logging.getLogger().removeHandler(console_handler)
|
51 |
-
console_handler.close()
|
|
|
15 |
args.multiple = True
|
16 |
args.no_download_sd_model = True
|
17 |
|
18 |
+
args = launch_utils.args
|
19 |
+
python = launch_utils.python
|
20 |
+
git = launch_utils.git
|
21 |
+
index_url = launch_utils.index_url
|
22 |
+
dir_repos = launch_utils.dir_repos
|
23 |
+
|
24 |
+
commit_hash = launch_utils.commit_hash
|
25 |
+
git_tag = launch_utils.git_tag
|
26 |
+
|
27 |
+
run = launch_utils.run
|
28 |
+
is_installed = launch_utils.is_installed
|
29 |
+
repo_dir = launch_utils.repo_dir
|
30 |
+
|
31 |
+
run_pip = launch_utils.run_pip
|
32 |
+
check_run_python = launch_utils.check_run_python
|
33 |
+
git_clone = launch_utils.git_clone
|
34 |
+
git_pull_recursive = launch_utils.git_pull_recursive
|
35 |
+
list_extensions = launch_utils.list_extensions
|
36 |
+
run_extension_installer = launch_utils.run_extension_installer
|
37 |
+
prepare_environment = launch_utils.prepare_environment
|
38 |
+
configure_for_tests = launch_utils.configure_for_tests
|
39 |
+
start = launch_utils.start
|
40 |
+
|
41 |
|
42 |
+
def main():
|
43 |
+
if args.dump_sysinfo:
|
44 |
+
filename = launch_utils.dump_sysinfo()
|
45 |
|
46 |
+
print(f"Sysinfo saved as {filename}. Exiting...")
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
exit(0)
|
|
|
|
|
49 |
|
50 |
+
launch_utils.startup_timer.record("initial startup")
|
51 |
+
|
52 |
+
with launch_utils.startup_timer.subcategory("prepare environment"):
|
53 |
+
if not args.skip_prepare_environment:
|
54 |
+
prepare_environment()
|
55 |
|
56 |
if args.test_server:
|
57 |
+
configure_for_tests()
|
58 |
+
|
59 |
+
start()
|
60 |
+
|
61 |
+
|
62 |
+
main()
|
|
|
|
|
|
|
|