From 16ab33ba3c2bbaf4c19a0b3ad2b844f8beab5d17 Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Fri, 17 Nov 2023 01:53:49 +0000 Subject: [PATCH] Added Obsolete markings to all `Eval` overloads --- LLama/LLamaContext.cs | 6 +++++- LLama/Native/SafeLLamaContextHandle.cs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/LLama/LLamaContext.cs b/LLama/LLamaContext.cs index b64befd8b..3a3e51af4 100644 --- a/LLama/LLamaContext.cs +++ b/LLama/LLamaContext.cs @@ -340,6 +340,7 @@ public LLamaTokenDataArray ApplyPenalty(IEnumerable lastTokens, Dic /// /// The updated `pastTokensCount`. /// + [Obsolete("use llama_decode() instead")] public int Eval(llama_token[] tokens, int pastTokensCount) { return Eval(tokens.AsSpan(), pastTokensCount); @@ -352,6 +353,7 @@ public int Eval(llama_token[] tokens, int pastTokensCount) /// /// The updated `pastTokensCount`. /// + [Obsolete("use llama_decode() instead")] public int Eval(List tokens, int pastTokensCount) { #if NET5_0_OR_GREATER @@ -382,6 +384,7 @@ public int Eval(List tokens, int pastTokensCount) /// /// The updated `pastTokensCount`. /// + [Obsolete("use llama_decode() instead")] public int Eval(ReadOnlyMemory tokens, int pastTokensCount) { return Eval(tokens.Span, pastTokensCount); @@ -394,6 +397,7 @@ public int Eval(ReadOnlyMemory tokens, int pastTokensCount) /// /// The updated `pastTokensCount`. /// + [Obsolete("use llama_decode() instead")] public int Eval(ReadOnlySpan tokens, int pastTokensCount) { var total = tokens.Length; @@ -415,7 +419,7 @@ public int Eval(ReadOnlySpan tokens, int pastTokensCount) } return pastTokensCount; } -#endregion + #endregion /// public void Dispose() diff --git a/LLama/Native/SafeLLamaContextHandle.cs b/LLama/Native/SafeLLamaContextHandle.cs index 59a5bfd9e..bb49cc0fa 100644 --- a/LLama/Native/SafeLLamaContextHandle.cs +++ b/LLama/Native/SafeLLamaContextHandle.cs @@ -193,6 +193,7 @@ public int TokenToSpan(int token, Span dest) /// The provided batch of new tokens to process /// the number of tokens to use from previous eval calls /// Returns true on success + [Obsolete("use llama_decode() instead")] public bool Eval(ReadOnlySpan tokens, int n_past) { unsafe