From bf33a19a3ec47c767a649dafb3982775c8029f16 Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Sun, 12 May 2024 21:18:08 +0100 Subject: [PATCH] Renamed `_temporarySampling` to `_samplingBuffer` --- LLama/LLamaContext.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LLama/LLamaContext.cs b/LLama/LLamaContext.cs index 2ab9e80ff..6335c1dc7 100644 --- a/LLama/LLamaContext.cs +++ b/LLama/LLamaContext.cs @@ -90,7 +90,7 @@ public uint BatchThreads /// public uint BatchSize => NativeHandle.BatchSize; - private LLamaTokenData[]? _temporarySampling; + private LLamaTokenData[]? _samplingBuffer; /// /// Create a new LLamaContext for the given LLamaWeights @@ -498,9 +498,9 @@ public LLamaTokenDataArray ApplyPenalty(int logits_i, IEnumerable la var nl_logit = logits[(int?)nl_token ?? 0]; // Convert logits into token candidates - if (_temporarySampling == null || _temporarySampling.Length < logits.Length) - _temporarySampling = new LLamaTokenData[logits.Length]; - var candidates_p = LLamaTokenDataArray.Create(logits, _temporarySampling); + if (_samplingBuffer == null || _samplingBuffer.Length < logits.Length) + _samplingBuffer = new LLamaTokenData[logits.Length]; + var candidates_p = LLamaTokenDataArray.Create(logits, _samplingBuffer); // Extract most recently returned tokens var last_n_repeat = Math.Min((int)ContextSize, repeatLastTokensCount);