Use reentrant generation lock (#6107)

This commit is contained in:
theo77186 2024-06-13 04:25:05 +02:00 committed by GitHub
parent a36fa73071
commit b675151f25
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: B5690EEEBB952194

View file

@ -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)