Skip to content

Commit 83ae708

Browse files
committed
make qwen3-emb working
1 parent 980c7db commit 83ae708

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

models/qwen.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,11 @@ namespace chatllm::qwen::v3_emb
14961496
Tokenizer *tok = dynamic_cast<Tokenizer *>(tokenizer);
14971497
tok->task = utils::get_opt(args, "task", tok->task);
14981498
}
1499+
1500+
int ConditionalGeneration::get_text_embedding_dim(void) const
1501+
{
1502+
return config.hidden_size;
1503+
}
14991504
}
15001505

15011506
namespace chatllm::qwen::v3_ranker

models/qwen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ namespace chatllm::qwen
605605
ModelType type = ModelType::MODEL_TYPE_QWEN3_Embedding, const bool skip_lm_head = true, int extra_tensors = 0);
606606

607607
void set_additional_args(const std::map<std::string, std::string> &args) override;
608+
int get_text_embedding_dim(void) const override;
608609
};
609610
}
610611

src/chat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ namespace chatllm
12981298
cache_type(ggml::str_to_type(cache_type, ggml::type::GGML_TYPE_F16)),
12991299
re_quantize(ggml::str_to_type(re_quantize))
13001300
{}
1301-
extra_args() : extra_args(-1, "", "", false, 1, 0, "") {}
1301+
extra_args() : extra_args(-1, "", false, 1, 0, "") {}
13021302
};
13031303

13041304
ModelObject(const std::string &path);

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,8 @@ chatllm::BaseStreamer *get_streamer_for_log(void)
11571157

11581158
static int init_vector_store(Args &args)
11591159
{
1160-
chatllm::Pipeline pipeline(args.embedding_model_path);
1160+
DEF_ExtraArgs(pipe_args, args);
1161+
chatllm::Pipeline pipeline(args.embedding_model_path, pipe_args);
11611162
args.max_length = pipeline.model->get_max_length();
11621163

11631164
DEF_GenerationConfig(gen_config, args);

0 commit comments

Comments
 (0)