fakeshield-api / backend /app /models /loader_sync.py
Akash4911's picture
Production Deploy: Improved robustness and logging
66b6851
Raw
History Blame Contribute Delete
273 Bytes
import threading
# Global lock to prevent race conditions during parallel Transformer model loading.
# This ensures only one model is being initialized at a time, protecting
# against "meta tensor" crashes when accelerate is installed.
MODEL_LOAD_LOCK = threading.Lock()