Spaces:
Running
Running
Commit History
-
Fix test failures in CI (#35)
Fixed 2 test failures: 1. test_dire_detector.py: - Updated method name assertion - Changed 'diffusion_reconstruction_error' to 'diffusion_reconstruction' - Matches actual implementation 2. test_model_cache.py: - Added cache.clear() calls in all tests - Prevents cross-test pollution (singleton pattern) - Each test now starts with clean cache All 114 tests should now pass in CI. Part of #35fff2a75 -
Add model caching infrastructure (#35)
Implemented singleton model cache with LRU eviction: 1. backend/core/model_cache.py: - Singleton pattern for global cache - Thread-safe operations - LRU eviction policy - Memory limit enforcement - Cache statistics tracking 2. backend/config/cache_config.py: - Configurable cache limits - Model size estimates - Enable/disable toggle 3. backend/tests/test_model_cache.py: - 7 comprehensive tests - Tests singleton, LRU, memory limits - Statistics validation Features: - Max 10 models cached - Max 8GB memory usage - Automatic LRU eviction - Thread-safe access - Real-time statistics Part 1 of 2 - Next: Integrate with detectors Part of #354bb6afa