Skip to content

Commit

Permalink
compatibility with model_api for modelconfig response (#95)
Browse files Browse the repository at this point in the history
* compatibility with model_api for modelconfig response

* error handling
  • Loading branch information
dtrawins authored Nov 5, 2024
1 parent f90329b commit 95fb088
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mediapipe/calculators/ovms/modelapiovmsadapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,16 @@ void OVMSInferenceAdapter::loadModel(const std::shared_ptr<const ov::Model>& mod
}
const ov::AnyMap* servableMetadataRtInfo;
ASSERT_CAPI_STATUS_NULL(OVMS_ServableMetadataInfo(servableMetadata, reinterpret_cast<const void**>(&servableMetadataRtInfo)));
this->modelConfig = *servableMetadataRtInfo;
try {
if ((*servableMetadataRtInfo).count("model_info") == 0) {
this->modelConfig = ov::AnyMap{};
} else {
this->modelConfig = (*servableMetadataRtInfo).at("model_info").as<ov::AnyMap>();
}
} catch (const std::exception& e) {
LOG(INFO) << "Exception occurred while accessing model_info: " << e.what();
this->modelConfig = ov::AnyMap{};
}
}

ov::element::Type_t OVMSInferenceAdapter::getInputDatatype(const std::string& inputName) const {
Expand Down

0 comments on commit 95fb088

Please sign in to comment.