Skip to content

Commit

Permalink
feat: whitelist jina bert v2 for llama-server embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Aug 12, 2024
1 parent 4134999 commit afa6800
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,10 @@ struct server_context {
n_ctx = llama_n_ctx(ctx);

add_bos_token = llama_should_add_bos_token(model);
GGML_ASSERT(llama_add_eos_token(model) != 1);

if (!llama_model_has_encoder(model)) {
GGML_ASSERT(llama_add_eos_token(model) != 1);
}

return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17190,6 +17190,7 @@ bool llama_model_has_encoder(const struct llama_model * model) {
switch (model->arch) {
case LLM_ARCH_T5: return true;
case LLM_ARCH_T5ENCODER: return true;
case LLM_ARCH_JINA_BERT_V2: return true;
default: return false;
}
}
Expand Down

0 comments on commit afa6800

Please sign in to comment.