Skip to content

Commit

Permalink
Merge pull request #3148 from alibaba/feature/bugfix
Browse files Browse the repository at this point in the history
LLM:Bugfix: Fix compile bug for mllm
  • Loading branch information
jxt1234 authored Jan 3, 2025
2 parents dd43b5a + 110ac6a commit f0454f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/transformers/llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ options:
```
- 需要开启音频功能时,增加相关编译宏
```
-DLLM_SUPPORT_AUDIO=true
-DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true
```

#### mac / linux / windows
Expand Down
6 changes: 2 additions & 4 deletions transformers/llm/engine/src/llm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ std::vector<int> 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<std::chrono::microseconds>(et - st).count();
mState.vision_us_ = std::chrono::duration_cast<std::chrono::microseconds>(et - st).count();
mul_embeddings_.push_back(image_embedding);
int visual_len = image_embedding->getInfo()->dim[0];
std::vector<int> img_ids(visual_len, img_pad_);
Expand Down Expand Up @@ -1115,7 +1115,7 @@ std::vector<int> 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<std::chrono::microseconds>(et - st).count();
mState.audio_us_ = std::chrono::duration_cast<std::chrono::microseconds>(et - st).count();
mul_embeddings_.push_back(audio_embedding);
int embed_len = audio_embedding->getInfo()->dim[0];
std::vector<int> audio_ids(embed_len, audio_pad_);
Expand Down Expand Up @@ -1172,11 +1172,9 @@ std::vector<int> 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()) {
Expand Down

0 comments on commit f0454f6

Please sign in to comment.