Skip to content

Commit

Permalink
fix: embedding
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <thxcode0824@gmail.com>
  • Loading branch information
thxCode committed Jul 29, 2024
1 parent 7756804 commit 632b63a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llama-box/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,9 @@ struct server_context {
bool load_model(const llama_box_params &bparams) {
params = bparams.gparams;

// always disable embedding for the server
params.embedding = false;

// load multimodal projection model
if (!params.mmproj.empty()) {
if (params.n_ctx < 2048) {
Expand Down Expand Up @@ -2439,6 +2442,9 @@ struct server_context {
return;
}

// make sure we're in the right embedding mode
llama_set_embeddings(ctx, batch_type == 1);

// process the created batch of tokens
for (int32_t i = 0; i < batch.n_tokens; i += n_batch) {
const int32_t n_tokens = std::min(n_batch, batch.n_tokens - i);
Expand Down

0 comments on commit 632b63a

Please sign in to comment.