File size: 217 Bytes
7344bef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import threading
from contextlib import contextmanager


_lock = threading.RLock()


@contextmanager
def model_unload_guard():
    with _lock:
        yield


def wait_for_model_unload():
    with _lock:
        pass