Skip to content

Commit

Permalink
fix: windows compile bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenghuaWang committed Sep 22, 2024
1 parent a5ed585 commit 6da1f06
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,9 @@ class Tensor {
}
}
}
for (auto &child_tensor : child_tensors_) {
auto it = child_tensors_.begin();
while (it != child_tensors_.end()) {
auto &child_tensor = *it;
auto origin_shape_offset = child_tensor->shapeOffset();
if (!origin_shape_offset.empty()) {
if (!shape_offset.empty()) {
Expand All @@ -957,7 +959,7 @@ class Tensor {
} else {
child_tensor->deepCopyFrom(source, false, {}, head_rep);
}
child_tensors_.erase(std::remove(child_tensors_.begin(), child_tensors_.end(), child_tensor), child_tensors_.end());
it = child_tensors_.erase(it);
}
source->addChildTensor(this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/backends/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if(OpenMP_FOUND)
message(STATUS "found openmp")
if(ARM AND NOT APK)
message(STATUS "[ARM] found openmp")
target_compile_options(MLLM_CPU PRIVATE -fopenmp)
target_compile_options(MLLM_CPU PUBLIC -fopenmp)
target_link_libraries(MLLM_CPU PUBLIC -fopenmp -static-openmp)
else()
target_link_libraries(MLLM_CPU
Expand Down
1 change: 1 addition & 0 deletions src/models/llava/processing_llava.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "processor/ClipPreProcess.hpp"
#include <numeric>
#include <utility>
#include <array>

using namespace mllm;

Expand Down
1 change: 1 addition & 0 deletions src/processor/AudioProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "AudioProcess.hpp"
#include <iomanip>
#include <numeric>
#include <utility>
#include <iostream>
#include <memory>
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ target_link_libraries(
MLLM_TEST
GTest::gtest_main
MLLM_CPU
-fopenmp
)
add_executable(
memoryPoolTest
Expand Down
3 changes: 2 additions & 1 deletion tools/convertor/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
torch
numpy
numpy
safetensors

0 comments on commit 6da1f06

Please sign in to comment.