Skip to content

Commit 2ae6078

Browse files
author
plusbang
committed
fix cmt
1 parent af9c18a commit 2ae6078

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/cpp/src/module_genai/modules/md_text_encoder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ bool TextEncoderModule::initialize(const std::filesystem::path& tokenizer_path,
4848
}
4949

5050
TokenizedInputs TextEncoderModule::run(const std::string& prompt) {
51-
// TODO: 似乎暂时缺少各模块的initiate?hard code here
52-
std::filesystem::path tokenizer_path = "/mnt/disk2/Qwen2.5-VL-7B-Instruct-INT4";
51+
// TODO: 似乎暂时缺少各模块的initiate?
52+
const auto& params = module_desc->params;
53+
auto it_path = params.find("model_path");
54+
std::filesystem::path tokenizer_path = it_path->second;
5355
m_tokenizer_impl = std::make_shared<Tokenizer::TokenizerImpl>(tokenizer_path, m_tokenization_params);
5456

5557
OPENVINO_ASSERT(m_tokenizer_impl, "TextEncoderModule is not initialized. Call initialize() first.");

src/cpp/src/module_genai/modules/md_text_encoder.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class TextEncoderModule : public IBaseModule {
3030
bool initialize(const std::filesystem::path& tokenizer_path,
3131
const ov::AnyMap& properties = {});
3232

33-
// TODO: 假定只有单条 prompt
34-
TokenizedInputs run(const std::string& prompt);
35-
3633
using PTR = std::shared_ptr<TextEncoderModule>;
3734
static PTR create(const IBaseModuleDesc::PTR& desc) {
3835
return PTR(new TextEncoderModule(desc));
@@ -42,6 +39,8 @@ class TextEncoderModule : public IBaseModule {
4239
std::shared_ptr<Tokenizer::TokenizerImpl> m_tokenizer_impl;
4340
ov::AnyMap m_tokenization_params = {};
4441
std::string m_prompt = "Describe this image.";
42+
// TODO: 假定只有单条 prompt
43+
TokenizedInputs run(const std::string& prompt);
4544
};
4645

4746
} // namespace module

0 commit comments

Comments
 (0)