diff --git a/plugins/grpc/src/server.hpp b/plugins/grpc/src/server.hpp index cb9b261..ae2192e 100644 --- a/plugins/grpc/src/server.hpp +++ b/plugins/grpc/src/server.hpp @@ -104,7 +104,14 @@ class KaldiServeImpl final : public kaldi_serve::KaldiServe::Service { KaldiServeImpl::KaldiServeImpl(const std::vector &model_specs) noexcept { for (auto const &model_spec : model_specs) { model_id_t model_id = std::make_pair(model_spec.name, model_spec.language_code); - decoder_queue_map_[model_id] = std::unique_ptr(new DecoderQueue(model_spec)); + try { + decoder_queue_map_[model_id] = std::unique_ptr(new DecoderQueue(model_spec));; + } catch (const std::runtime_error &e) { + std::cerr<<"Model not loaded: ("<