Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion plugins/grpc/src/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ class KaldiServeImpl final : public kaldi_serve::KaldiServe::Service {
KaldiServeImpl::KaldiServeImpl(const std::vector<ModelSpec> &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<DecoderQueue>(new DecoderQueue(model_spec));
try {
decoder_queue_map_[model_id] = std::unique_ptr<DecoderQueue>(new DecoderQueue(model_spec));;
} catch (const std::runtime_error &e) {
std::cerr<<"Model not loaded: ("<<model_id.first<<","<<model_id.second<<"). This raised an error:"<<e.what()<<"\n";
// Expected while creation of ChainModel. Eg- when kaldi model is missing.
// This catch keeps kaldi-serve from exiting due to this error.
// Do nothing here. `decoder_queue_map_` will simply not contain an entry for key `model_id`.
}
}
}

Expand Down