Download tests/conftest.py from RobinWu/nerserver: direct link, hf CLI and curl.
- Browser
- Download file 354 Bytes
-
https://huggingface.co/spaces/RobinWu/nerserver/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/RobinWu/nerserver/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/RobinWu/nerserver/resolve/main/tests/conftest.py
354 Bytes
| """ | |
| 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() | |