Skip to content

Commit

Permalink
Renamed _temporarySampling to _samplingBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
martindevans committed May 12, 2024
1 parent 9fbc045 commit bf33a19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions LLama/LLamaContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public uint BatchThreads
/// </summary>
public uint BatchSize => NativeHandle.BatchSize;

private LLamaTokenData[]? _temporarySampling;
private LLamaTokenData[]? _samplingBuffer;

/// <summary>
/// Create a new LLamaContext for the given LLamaWeights
Expand Down Expand Up @@ -498,9 +498,9 @@ public LLamaTokenDataArray ApplyPenalty(int logits_i, IEnumerable<LLamaToken> 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);
Expand Down

0 comments on commit bf33a19

Please sign in to comment.