| llama_encode | R Documentation |
Runs the encoder pass for encoder-decoder architectures (e.g. T5, BART). The encoder output is stored internally and used by subsequent decoder calls.
llama_encode(ctx, tokens)
ctx |
A context pointer (llama_context). |
tokens |
Integer vector of token IDs to encode. |
Integer return code (0 = success, negative = error).
## Not run:
model <- llama_load_model("t5-model.gguf")
ctx <- llama_new_context(model)
tokens <- llama_tokenize(ctx, "Hello world")
llama_encode(ctx, tokens)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.