inference
inference copied to clipboard
inference.Model is in __all__ but does not resolve after the lazy-init rewrite
Repro (current main)
inference/__init__.py lists Model in __all__ and keeps the TYPE_CHECKING import, but _LAZY_ATTRIBUTES only registers Stream, InferencePipeline, get_model, and get_roboflow_model.
import inference
inference.Model # AttributeError
from inference import Model # ImportError
Siblings (Stream, get_model, …) resolve. Type checkers pass. Runtime fails.
Introduced by the lazy-init rewrite in #2833. Confirmed by reading origin/main: __all__ includes Model; _LAZY_ATTRIBUTES does not.
Why it matters
Anyone following the advertised package exports (from inference import Model) cannot import. Not a crash in get_model(), but a broken public contract.
Fix
#2844 — one line in _LAZY_ATTRIBUTES + test_model_lazy_export.
Fixed by #2844