From 348c3be2099789feb7f70ba38465abf5ef370eaa Mon Sep 17 00:00:00 2001 From: streetycat <305190374@qq.com> Date: Tue, 5 Dec 2023 04:02:02 +0000 Subject: [PATCH] fix incorrect determination of subprocess failure --- .../local_compute_node_builder/local_llama_node_builder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/service/aios_shell/local_compute_node_builder/local_llama_node_builder.py b/src/service/aios_shell/local_compute_node_builder/local_llama_node_builder.py index d9bdcde..b2606c8 100644 --- a/src/service/aios_shell/local_compute_node_builder/local_llama_node_builder.py +++ b/src/service/aios_shell/local_compute_node_builder/local_llama_node_builder.py @@ -118,7 +118,7 @@ class ParameterExternParamsApplier: else: result = subprocess.run(['git', 'clone', llama_cpp_python_repo_url, llama_cpp_python_path], stdout = subprocess.PIPE, stderr = subprocess.PIPE, text = True) - if result.stderr: + if result.returncode: print_formatted_text(FormattedText([("class:warn", result.stderr)]), style = state.shell_style) while True: sel = await state.prompt_session.prompt_async(f"Update 'llama-cpp-python' failed, you can press 'r' to retry, or 'c' to continue with the current version.", style = state.shell_style) @@ -140,7 +140,7 @@ class ParameterExternParamsApplier: result = subprocess.run(['docker', 'rmi', docker_image], stdout = subprocess.PIPE, stderr = subprocess.PIPE, text = True) result = subprocess.run(['docker', 'build', '-t', docker_image, f"{llama_cpp_python_path}/docker/cuda_simple/"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, text = True) - if result.stderr: + if result.returncode: print_formatted_text(FormattedText([("class:warn", result.stderr)]), style = state.shell_style) while True: sel = await state.prompt_session.prompt_async(f"Build the image failed, you can press 'r' to retry, or 'c' to continue with the current version.", style = state.shell_style) @@ -179,7 +179,7 @@ class ParameterExternParamsApplier: result = subprocess.run(run_options, stdout = subprocess.PIPE, stderr = subprocess.PIPE, text = True) - if result.stderr: + if result.returncode: print_formatted_text(FormattedText([("class:warn", result.stderr)]), style = state.shell_style) while True: sel = await state.prompt_session.prompt_async(f"Start the node service failed, you can press 'r' to retry, or 'a' to abort.", style = state.shell_style)