From 110ac6a5e13f828b6086099888fc6cef8de095d5 Mon Sep 17 00:00:00 2001 From: xiaying Date: Fri, 3 Jan 2025 18:42:00 +0800 Subject: [PATCH] LLM:Bugfix: Fix compile bug for mllm --- docs/transformers/llm.md | 2 +- transformers/llm/engine/src/llm.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/transformers/llm.md b/docs/transformers/llm.md index bdd40739f..109a6b43f 100644 --- a/docs/transformers/llm.md +++ b/docs/transformers/llm.md @@ -107,7 +107,7 @@ options: ``` - 需要开启音频功能时,增加相关编译宏 ``` --DLLM_SUPPORT_AUDIO=true +-DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true ``` #### mac / linux / windows diff --git a/transformers/llm/engine/src/llm.cpp b/transformers/llm/engine/src/llm.cpp index 293e1af1b..264304650 100644 --- a/transformers/llm/engine/src/llm.cpp +++ b/transformers/llm/engine/src/llm.cpp @@ -1085,7 +1085,7 @@ std::vector Mllm::vision_process(const std::string& file) { image_embedding = mul_module_->forward(image); } auto et = std::chrono::system_clock::now(); - vision_us_ = std::chrono::duration_cast(et - st).count(); + mState.vision_us_ = std::chrono::duration_cast(et - st).count(); mul_embeddings_.push_back(image_embedding); int visual_len = image_embedding->getInfo()->dim[0]; std::vector img_ids(visual_len, img_pad_); @@ -1115,7 +1115,7 @@ std::vector Mllm::audio_process(const std::string& file) { auto audio_embedding = mul_module_->forward(input_features); audio_embedding = _Permute(audio_embedding, {1, 0, 2}); auto et = std::chrono::system_clock::now(); - audio_us_ = std::chrono::duration_cast(et - st).count(); + mState.audio_us_ = std::chrono::duration_cast(et - st).count(); mul_embeddings_.push_back(audio_embedding); int embed_len = audio_embedding->getInfo()->dim[0]; std::vector audio_ids(embed_len, audio_pad_); @@ -1172,11 +1172,9 @@ std::vector Mllm::multimode_process(const std::string& mode, std::string in file.close(); } else { std::cerr << "Unable to open file to write." << std::endl; - exit(0); } } else { std::cerr << "Failed to download file. Status code: " << (res ? res->status : 0) << std::endl; - exit(0); } } if (mode == "img" && config_->is_visual()) {