Browse Source

Added Obsolete markings to all `Eval` overloads

tags/v0.8.1
Martin Evans 2 years ago
parent
commit
16ab33ba3c
2 changed files with 6 additions and 1 deletions
  1. +5
    -1
      LLama/LLamaContext.cs
  2. +1
    -0
      LLama/Native/SafeLLamaContextHandle.cs

+ 5
- 1
LLama/LLamaContext.cs View File

@@ -340,6 +340,7 @@ namespace LLama
/// <param name="pastTokensCount"></param>
/// <returns>The updated `pastTokensCount`.</returns>
/// <exception cref="RuntimeError"></exception>
[Obsolete("use llama_decode() instead")]
public int Eval(llama_token[] tokens, int pastTokensCount)
{
return Eval(tokens.AsSpan(), pastTokensCount);
@@ -352,6 +353,7 @@ namespace LLama
/// <param name="pastTokensCount"></param>
/// <returns>The updated `pastTokensCount`.</returns>
/// <exception cref="RuntimeError"></exception>
[Obsolete("use llama_decode() instead")]
public int Eval(List<llama_token> tokens, int pastTokensCount)
{
#if NET5_0_OR_GREATER
@@ -382,6 +384,7 @@ namespace LLama
/// <param name="pastTokensCount"></param>
/// <returns>The updated `pastTokensCount`.</returns>
/// <exception cref="RuntimeError"></exception>
[Obsolete("use llama_decode() instead")]
public int Eval(ReadOnlyMemory<llama_token> tokens, int pastTokensCount)
{
return Eval(tokens.Span, pastTokensCount);
@@ -394,6 +397,7 @@ namespace LLama
/// <param name="pastTokensCount"></param>
/// <returns>The updated `pastTokensCount`.</returns>
/// <exception cref="RuntimeError"></exception>
[Obsolete("use llama_decode() instead")]
public int Eval(ReadOnlySpan<llama_token> tokens, int pastTokensCount)
{
var total = tokens.Length;
@@ -415,7 +419,7 @@ namespace LLama
}
return pastTokensCount;
}
#endregion
#endregion

/// <inheritdoc />
public void Dispose()


+ 1
- 0
LLama/Native/SafeLLamaContextHandle.cs View File

@@ -193,6 +193,7 @@ namespace LLama.Native
/// <param name="tokens">The provided batch of new tokens to process</param>
/// <param name="n_past">the number of tokens to use from previous eval calls</param>
/// <returns>Returns true on success</returns>
[Obsolete("use llama_decode() instead")]
public bool Eval(ReadOnlySpan<int> tokens, int n_past)
{
unsafe


Loading…
Cancel
Save