Skip to content

Commit

Permalink
Merge pull request #2559 from MaaXYZ/fix/build_error
Browse files Browse the repository at this point in the history
fix: build error without ENABLE_PADDLE2ONNX
  • Loading branch information
Jiang-Jia-Jun authored Jan 10, 2025

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
2 parents 618826b + 11214a6 commit d4bbdbe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fastdeploy/runtime/backends/ort/ort_backend.cc
Original file line number Diff line number Diff line change
@@ -260,8 +260,13 @@ bool OrtBackend::InitFromOnnx(const std::string& model_file,
}
char* model_content_ptr;
int model_content_size = 0;
#ifdef ENABLE_PADDLE2ONNX
paddle2onnx::ConvertFP32ToFP16(model_file.c_str(), model_file.size(),
&model_content_ptr, &model_content_size);
#else
FDERROR << "Didn't compile with ENABLE_PADDLE2ONNX, FP16 is not supported" << std::endl;
return false;
#endif
std::string onnx_model_proto(model_content_ptr,
model_content_ptr + model_content_size);
delete[] model_content_ptr;

0 comments on commit d4bbdbe

Please sign in to comment.