Skip to content

Commit e896858

Browse files
committed
sampling
1 parent 135870c commit e896858

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/src/llama.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ class Llama {
3838
/// Cursor position in the token list. Default is 0.
3939
int cursor = 0;
4040

41-
/// Counter for decoding operations. Default is 0.
42-
int decode = 0;
43-
4441
/// set llama.cpp library path
4542
static String? libraryPath;
4643

@@ -186,7 +183,7 @@ class Llama {
186183
final int nVocab = lib.llama_n_vocab(model);
187184

188185
// Get the logits for the last token generated.
189-
final logits = lib.llama_get_logits_ith(context, batch.n_tokens - 1);
186+
final logits = lib.llama_get_logits(context);
190187

191188
// Prepare candidates array to hold token data for all vocabulary items.
192189
final Pointer<llama_token_data> candidates = calloc<llama_token_data>(nVocab);
@@ -239,7 +236,6 @@ class Llama {
239236
lastTokens.add(newTokenId.value);
240237

241238
// Increment the counters.
242-
decode++;
243239
cursor++;
244240

245241
// Process the next token.
@@ -282,7 +278,6 @@ class Llama {
282278
lib.llama_kv_cache_clear(context);
283279
batch.n_tokens = 0;
284280
cursor = 0;
285-
decode = 0;
286281
}
287282

288283
// Utility methods

0 commit comments

Comments
 (0)