feat: add the api to get the embedding length of the model.
This commit is contained in:
parent
d609b0e1d5
commit
3a1daa98a3
|
@ -41,6 +41,20 @@ namespace LLama
|
|||
/// The encoding set for this model to deal with text input.
|
||||
/// </summary>
|
||||
public Encoding Encoding => _encoding;
|
||||
/// <summary>
|
||||
/// The embedding length of the model, also known as `n_embed`
|
||||
/// </summary>
|
||||
public int EmbeddingLength
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_ctx is null)
|
||||
{
|
||||
throw new NullReferenceException("The native context has not been created in this model.");
|
||||
}
|
||||
return NativeApi.llama_n_embd(_ctx);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue