!48326 [Bugfix] Model Decryption: Filename contains special characters could cause fail to find the file

Merge pull request !48326 from 张澍坤/master
This commit is contained in:
i-robot 2023-02-06 07:24:05 +00:00 committed by Gitee
commit 5244ccf8bb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ Status Model::Build(const std::vector<char> &model_path, ModelType model_type,
}
if (dec_key.len > 0) {
size_t model_size;
auto model_buf = lite::ReadFile(model_path.data(), &model_size);
auto model_buf = lite::ReadFile(CharToString(model_path).c_str(), &model_size);
if (model_buf == nullptr) {
MS_LOG(ERROR) << "Read model file failed";
return kLiteError;