LLamaEmbedder
Namespace: LLama
The embedder for LLama, which supports getting embeddings from text.
public sealed class LLamaEmbedder : System.IDisposable
Inheritance Object → LLamaEmbedder
Implements IDisposable
Properties
EmbeddingSize
Dimension of embedding vectors
public int EmbeddingSize { get; }
Property Value
Constructors
LLamaEmbedder(IModelParams)
public LLamaEmbedder(IModelParams params)
Parameters
params
IModelParams
LLamaEmbedder(LLamaWeights, IModelParams)
public LLamaEmbedder(LLamaWeights weights, IModelParams params)
Parameters
weights
LLamaWeights
params
IModelParams
Methods
GetEmbeddings(String, Int32, Boolean, String)
Caution
'threads' and 'encoding' parameters are no longer used
Get the embeddings of the text.
public Single[] GetEmbeddings(string text, int threads, bool addBos, string encoding)
Parameters
text
String
threads
Int32
unused
addBos
Boolean
Add bos to the text.
encoding
String
unused
Returns
Exceptions
GetEmbeddings(String)
Get the embeddings of the text.
public Single[] GetEmbeddings(string text)
Parameters
text
String
Returns
Exceptions
GetEmbeddings(String, Boolean)
Get the embeddings of the text.
public Single[] GetEmbeddings(string text, bool addBos)
Parameters
text
String
addBos
Boolean
Add bos to the text.
Returns
Exceptions
Dispose()
public void Dispose()