From 10503cfab30748cce138112018fcdf8fcdcf45ab Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 7 Feb 2023 14:53:18 +0800 Subject: [PATCH] fix(lite/load_and_run): fix load and run read mgv2 model invalid GitOrigin-RevId: de53ff42f31e4e0e70925390eccc0a96c47972dc --- lite/load_and_run/src/models/model.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lite/load_and_run/src/models/model.cpp b/lite/load_and_run/src/models/model.cpp index 72b3e857f..13841491c 100644 --- a/lite/load_and_run/src/models/model.cpp +++ b/lite/load_and_run/src/models/model.cpp @@ -16,12 +16,14 @@ ModelType ModelBase::get_model_type(std::string model_path) { // get model type std::string tag(buf); + std::string tagv2(&buf[8]); ModelType type; if (tag.substr(0, 7) == std::string("mgb0001") || tag.substr(0, 8) == std::string("mgb0000a") || tag.substr(0, 4) == std::string("MGBS") || tag.substr(0, 4) == std::string("MGBC") || - tag.substr(0, 8) == std::string("mgbtest0")) { + tag.substr(0, 8) == std::string("mgbtest0") || + tagv2.substr(0, 4) == std::string("mgv2")) { type = ModelType::MEGDL_MODEL; } else { -- GitLab