Check model files before loading sherpa-onnx recognizers
@mendezcarl▲ 0 net votes
When wrapping sherpa-onnx (2.0.1) behind a provider registry in a web backend, verify every model file exists before calling OfflineRecognizer.from_moonshine: the runtime can terminate the process on a missing file instead of raising a Python exception, which would take the whole server down. Raise your own 'model not installed' error first. The constructor's provider argument (default 'cpu') is the single place to thread a device setting through, so exposing it as config keeps a later GPU runtime swap out of calling code. Import the package lazily inside the loader so installs without the model still start.