From b675151f25b2814a56aa567fa7f68b28f6952872 Mon Sep 17 00:00:00 2001 From: theo77186 Date: Thu, 13 Jun 2024 04:25:05 +0200 Subject: [PATCH] Use reentrant generation lock (#6107) --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 04a5b16d..a8237ba6 100644 --- a/server.py +++ b/server.py @@ -32,7 +32,7 @@ import sys import time from functools import partial from pathlib import Path -from threading import Lock, Thread +from threading import RLock, Thread import yaml @@ -243,7 +243,7 @@ if __name__ == "__main__": if shared.args.lora: add_lora_to_model(shared.args.lora) - shared.generation_lock = Lock() + shared.generation_lock = RLock() if shared.args.idle_timeout > 0: timer_thread = Thread(target=unload_model_if_idle)