From a787ebe7cf712ef9720e5965a798e32e439ae21a Mon Sep 17 00:00:00 2001 From: Eugene Palmoff Date: Thu, 21 Dec 2023 14:51:36 +0500 Subject: [PATCH] Handle broken pipe error (#572) --- koboldcpp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koboldcpp.py b/koboldcpp.py index 280b88372..7f977b396 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -626,7 +626,7 @@ class ServerRequestHandler(http.server.SimpleHTTPRequestHandler): await asyncio.gather(*tasks) generate_result = generate_task.result() return generate_result - except ConnectionAbortedError as cae: # attempt to abort if connection lost + except (BrokenPipeError, ConnectionAbortedError) as cae: # attempt to abort if connection lost print(cae) handle.abort_generate() time.sleep(0.1) #short delay