# overridable via env, e.g. DETECTOR_FLOOR_LOCATION=0.6). Role nouns are demoted
# by the suppressor labels (below), not by this floor.
PER_LABEL_FLOOR = {
- "person": _floor("person", 0.85),
- "location": _floor("location", 0.50),
+ "person": _floor("person", 0.95),
+ "location": _floor("location", 0.80),
# A dedicated "address" label recovers full street addresses that a bare
# "location" reading misses; emitted as LOCATION (see _LABEL_TO_TYPE).
- "address": _floor("address", 0.70),
+ "address": _floor("address", 0.80),
}
# Labels the request `score_threshold` may raise (high-volume, deployment-tunable).
_TUNABLE = {"person", "location", "address"}
# pin it for every arch. (PyPI's DEFAULT index now ships CUDA builds for
# linux/arm64 too — e.g. torch 2.x+cuXXX — which would drag ~6 GB of unused
# CUDA libraries into the image; the explicit CPU index avoids that.)
-RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
+RUN pip install --no-cache-dir typing-extensions \
+ && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
# Install the detector package (pulls fastapi/uvicorn/gliner/stdnum/...).
COPY detector/pyproject.toml /srv/detector/