allow to toggle embedding mode
This commit is contained in:
parent
f618e5060a
commit
bd3d9fbfed
5 changed files with 21 additions and 12 deletions
|
@ -125,15 +125,14 @@ int main(int argc, char* argv[])
|
|||
return true;
|
||||
};
|
||||
|
||||
cparams.embeddings = true;
|
||||
cparams.causal_attn = false;
|
||||
cparams.pooling_type = LLAMA_POOLING_TYPE_NONE;
|
||||
|
||||
llama_backend_init();
|
||||
|
||||
auto mdl = llama_load_model_from_file(params.model.c_str(), mparams);
|
||||
auto ctx = llama_new_context_with_model(mdl, cparams);
|
||||
|
||||
// set to embedding mode
|
||||
llama_set_embeddings(ctx, true);
|
||||
|
||||
// ### Embedding/Representation ### taken sample from here:
|
||||
// https://github.com/ContextualAI/gritlm?tab=readme-ov-file#basic
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue