| 155 | } |
| 156 | |
| 157 | bool loadModelFromFile(std::filesystem::path modelPath) |
| 158 | { |
| 159 | modelPath = getModelFullPath(modelPath); |
| 160 | std::ifstream modelFile(modelPath, std::ios::binary); |
| 161 | |
| 162 | if (modelFile.is_open()) { |
| 163 | if (Config::loadModel(modelFile)) |
| 164 | return true; |
| 165 | else |
| 166 | ERRORL("Failed to load model from [" |
| 167 | << modelPath << "]. Please check if model binary file is correct."); |
| 168 | } |
| 169 | else |
| 170 | ERRORL("Unable to open model file: " << modelPath); |
| 171 | |
| 172 | return false; |
| 173 | } |
| 174 | |
| 175 | } // namespace Command |
no test coverage detected