File size: 354 Bytes
bfeb704 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | """
Mock gliner and torch before any app module is imported.
Prevents torch's BLAS FPE check from crashing on Windows during unit tests.
"""
import sys
from unittest.mock import MagicMock
for mod in ("torch", "gliner", "gliner.model"):
sys.modules.setdefault(mod, MagicMock())
_gliner_stub = sys.modules["gliner"]
_gliner_stub.GLiNER = MagicMock()
|