Skip to content

Commit

Permalink
native
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Feb 5, 2025
1 parent e468923 commit 86a5e7f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/src/llama_cpp_native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ class LlamaCppNative {
}

final buffer = calloc<ffi.Char>(256);
final n = lib.llama_token_to_piece(vocab, newTokenId, buffer, 256, 0, true);
if (n < 0) {
if (lib.llama_token_to_piece(vocab, newTokenId, buffer, 256, 0, true) < 0) {
throw Exception('Failed to convert token to piece');
}

Expand Down

0 comments on commit 86a5e7f

Please sign in to comment.