Skip to content

Commit d4bbdbe

Browse files
Merge pull request #2559 from MaaXYZ/fix/build_error
fix: build error without ENABLE_PADDLE2ONNX
2 parents 618826b + 11214a6 commit d4bbdbe

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fastdeploy/runtime/backends/ort/ort_backend.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,13 @@ bool OrtBackend::InitFromOnnx(const std::string& model_file,
260260
}
261261
char* model_content_ptr;
262262
int model_content_size = 0;
263+
#ifdef ENABLE_PADDLE2ONNX
263264
paddle2onnx::ConvertFP32ToFP16(model_file.c_str(), model_file.size(),
264265
&model_content_ptr, &model_content_size);
266+
#else
267+
FDERROR << "Didn't compile with ENABLE_PADDLE2ONNX, FP16 is not supported" << std::endl;
268+
return false;
269+
#endif
265270
std::string onnx_model_proto(model_content_ptr,
266271
model_content_ptr + model_content_size);
267272
delete[] model_content_ptr;

0 commit comments

Comments
 (0)