From 3fd01874f82f5454b40f5cd9270083dc70895ad7 Mon Sep 17 00:00:00 2001 From: grawity Date: Wed, 4 Oct 2023 18:27:57 +0300 Subject: [PATCH] avoid leaving a zombie process for --onready Popen() needs to be used with 'with' or have .wait() called or be destroyed, otherwise there is a zombie child that sticks around until the object is GC'd. --- koboldcpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koboldcpp.py b/koboldcpp.py index 406d0f16f1819..d4c490571ead5 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -1951,7 +1951,7 @@ def main(launch_args,start_server=True): def onready_subprocess(): import subprocess print("Starting Post-Load subprocess...") - subprocess.Popen(args.onready[0], shell=True) + subprocess.run(args.onready[0], shell=True) timer_thread = threading.Timer(1, onready_subprocess) #1 second delay timer_thread.start() @@ -2021,4 +2021,4 @@ def onready_subprocess(): parser.add_argument("--unbantokens", help="--unbantokens is DEPRECATED and will be removed soon! EOS unbans should now be set via the generate API", action='store_true') parser.add_argument("--usemirostat", help="--usemirostat is DEPRECATED and will be removed soon! Mirostat values should now be set via the generate API",metavar=('[type]', '[tau]', '[eta]'), type=float, nargs=3) - main(parser.parse_args(),start_server=True) \ No newline at end of file + main(parser.parse_args(),start_server=True)