Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Llm:Feature] Support Qwen2-VL export and inference. #3029

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/core/TensorUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Backend.hpp"
#include "AutoStorage.h"
#include "Tensor_generated.h"
#define MNN_MAX_TENSOR_DIM 8
#define MNN_MAX_TENSOR_DIM 9

#ifdef CONSTANT
#undef CONSTANT
Expand Down Expand Up @@ -187,7 +187,7 @@ class MNN_PUBLIC TensorUtils {
static bool isTileRegion(const Tensor::InsideDescribe::Region& region);
static bool isDepthToSpaceRegions(const Tensor* output);
static bool reshapeSlice(Tensor::InsideDescribe::Region& slice, int outside, int inside, int axis);

class FuseRegionStatus;
class MNN_PUBLIC FuseWrap {
public:
Expand All @@ -201,10 +201,10 @@ class MNN_PUBLIC TensorUtils {
static void adjustTensorForCompability(Tensor* t);
static Tensor::DimensionType getDimType(const Tensor* t);
static std::vector<float> getQuantInfo(const Tensor* t);

static size_t getRawSize(const Tensor* t);
static void setRasterInputs(Command* cmd);

static bool refTensorContent(Tensor* dst, const Tensor* src);

static int getTensorChannelPack(const Tensor* tensor);
Expand Down
8 changes: 8 additions & 0 deletions transformers/llm/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
option(LLM_SUPPORT_VISION "Llm model support vision input." OFF)

if (LLM_SUPPORT_VISION)
add_definitions(-DLLM_SUPPORT_VISION)
list(APPEND MNN_DEPS MNNOpenCV)
include_directories(${CMAKE_SOURCE_DIR}/tools/cv/include/)
endif()

# include dir
include_directories(${CMAKE_CURRENT_LIST_DIR}/include/)

Expand Down
1 change: 0 additions & 1 deletion transformers/llm/engine/include/llm/llm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class MNN_PUBLIC Llm {
virtual MNN::Express::VARP gen_attention_mask(int seq_len);
virtual MNN::Express::VARP gen_position_ids(int seq_len);
bool mTracing = false;

};

// Embedding start
Expand Down
Loading
Loading