Skip to content

Commit eca2ae8

Browse files
committed
fix: build error without ENABLE_PADDLE2ONNX
1 parent 3bb05ac commit eca2ae8

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 PaddlePaddle Frontend, 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)