Skip to content

Commit

Permalink
greedy
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Feb 10, 2025
1 parent 1e9a87a commit 4dccaea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ class _LlamaAppState extends State<LlamaApp> {
nCtx: 2048,
nBatch: 2048
),
samplingParams: SamplingParams(
minP: const MinPArguments(p: 0.05, minKeep: 1),
temperature: const TemperatureArguments(temperature: 0.8),
seed: Random().nextInt(1000000)
samplingParams: const SamplingParams(
greedy: true
)
);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/llama_native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class LlamaNative implements Llama {
throw Exception('Failed to apply template');
}

final prompt = formatted.cast<Utf8>().toDartString().substring(_contextLength, newContextLength);
final prompt = formatted.cast<Utf8>().toDartString().substring(_contextLength);

final vocab = Llama.lib.llama_model_get_vocab(_model);
final isFirst = Llama.lib.llama_get_kv_cache_used_cells(_context) == 0;
Expand Down

0 comments on commit 4dccaea

Please sign in to comment.