Skip to content

Commit

Permalink
Merge pull request #459 from intel/ankit/ov_config_loader_v2
Browse files Browse the repository at this point in the history
update: handling few edge cases for parsing
  • Loading branch information
ankitm3k authored Sep 30, 2024
2 parents 39f5d4c + 9999cd3 commit 91cb834
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions onnxruntime/core/providers/openvino/backend_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ void LoadConfig(const std::string& filename, std::map<std::string, ov::AnyMap>&
throw std::runtime_error("Unknown exception for config file \"" + filename + "\".\n");
}

if (json_config.empty()) {
ORT_THROW("Empty JSON content passed \"" + filename + "\".");
}

for (auto item = json_config.cbegin(), end = json_config.cend(); item != end; ++item) {
const std::string& deviceName = item.key();
const auto& item_value = item.value();
Expand Down

0 comments on commit 91cb834

Please sign in to comment.