Skip to content

Commit

Permalink
Address build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yuslepukhin committed Sep 13, 2024
1 parent 115a231 commit 30f3e63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/onnxruntime_session.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif()
source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_session_srcs})

onnxruntime_add_static_library(onnxruntime_session ${onnxruntime_session_srcs})
onnxruntime_add_include_to_target(onnxruntime_session onnxruntime_common onnxruntime_lora onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface nlohmann_json::nlohmann_json)
onnxruntime_add_include_to_target(onnxruntime_session onnxruntime_common onnxruntime_framework onnxruntime_lora onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface nlohmann_json::nlohmann_json)
target_link_libraries(onnxruntime_session PRIVATE onnxruntime_lora)
if(onnxruntime_ENABLE_INSTRUMENT)
target_compile_definitions(onnxruntime_session PUBLIC ONNXRUNTIME_ENABLE_INSTRUMENT)
Expand Down
3 changes: 1 addition & 2 deletions onnxruntime/python/onnxruntime_pybind_lora.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ void addAdapterFormatMethods(pybind11::module& m) {

py::class_<lora::LoraAdapter> lora_adapter_binding(m, "LoraAdapter");
lora_adapter_binding.def(py::init())
.def("Load", [](lora::LoraAdapter* adapter, const std::wstring& file_path) { adapter->MemoryMap(file_path); },
R"pbdoc(Memory map the specified file as LoraAdapter)pbdoc");
.def("Load", [](lora::LoraAdapter* adapter, const std::wstring& file_path) { adapter->MemoryMap(file_path); }, R"pbdoc(Memory map the specified file as LoraAdapter)pbdoc");
}

} // namespace python
Expand Down
6 changes: 4 additions & 2 deletions onnxruntime/python/onnxruntime_pybind_mlvalue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,15 @@ static TensorShape GetArrayShape(PyArrayObject* pyObject) {
const int ndim = PyArray_NDIM(pyObject);
const npy_intp* npy_dims = PyArray_DIMS(pyObject);
auto span = gsl::make_span(npy_dims, ndim);
TensorShape shape(span);
TensorShapeVector shape_vec(span.begin(), span.end());
TensorShape shape(shape_vec);
return shape;
}

TensorShape GetShape(const py::array& arr) {
auto span = gsl::make_span(arr.shape(), arr.ndim());
TensorShape shape(span);
TensorShapeVector shape_vec(span.begin(), span.end());
TensorShape shape(shape_vec);
return shape;
}

Expand Down

0 comments on commit 30f3e63

Please sign in to comment.