Enhancement - using uvicorn.run() instead of os.system()

This commit is contained in:
Siavosh Kasravi 2024-06-05 11:12:21 +03:30
parent 66d0c4726e
commit 91ad53cd94

View File

@ -369,9 +369,9 @@ def launch_uvicorn():
setup_amd_environment() setup_amd_environment()
print("\nLaunching uvicorn\n") print("\nLaunching uvicorn\n")
os.system(
f'python -m uvicorn main:server_api --app-dir "{os.environ["SD_UI_PATH"]}" --port {listen_port} --host {bind_ip} --log-level error' from uvicorn import run
) run("main:server_api", port=listen_port, log_level="error", app_dir=os.environ["SD_UI_PATH"], host=bind_ip, access_log=False)
### Start ### Start